openvidu-browser: fix local StreamPropertyChangedEvent filter (options as object instead of string)

pull/621/head
pabloFuente 2021-03-24 12:15:19 +01:00
parent e59e9033f8
commit faf7f6820b
1 changed files with 5 additions and 4 deletions

View File

@ -293,13 +293,14 @@ export class Stream {
} }
logger.info('Applying filter to stream ' + this.streamId); logger.info('Applying filter to stream ' + this.streamId);
options = !!options ? options : {}; options = options != null ? options : {};
if (typeof options !== 'string') { let optionsString = options;
options = JSON.stringify(options); if (typeof optionsString !== 'string') {
optionsString = JSON.stringify(optionsString);
} }
this.session.openvidu.sendRequest( this.session.openvidu.sendRequest(
'applyFilter', 'applyFilter',
{ streamId: this.streamId, type, options }, { streamId: this.streamId, type, options: optionsString },
(error, response) => { (error, response) => {
if (error) { if (error) {
logger.error('Error applying filter for Stream ' + this.streamId, error); logger.error('Error applying filter for Stream ' + this.streamId, error);