diff --git a/openvidu-browser/src/OpenVidu/Stream.ts b/openvidu-browser/src/OpenVidu/Stream.ts index d72f3e47..b7b427b1 100644 --- a/openvidu-browser/src/OpenVidu/Stream.ts +++ b/openvidu-browser/src/OpenVidu/Stream.ts @@ -293,13 +293,14 @@ export class Stream { } logger.info('Applying filter to stream ' + this.streamId); - options = !!options ? options : {}; - if (typeof options !== 'string') { - options = JSON.stringify(options); + options = options != null ? options : {}; + let optionsString = options; + if (typeof optionsString !== 'string') { + optionsString = JSON.stringify(optionsString); } this.session.openvidu.sendRequest( 'applyFilter', - { streamId: this.streamId, type, options }, + { streamId: this.streamId, type, options: optionsString }, (error, response) => { if (error) { logger.error('Error applying filter for Stream ' + this.streamId, error);