diff --git a/openvidu-browser/src/OpenVidu/Session.ts b/openvidu-browser/src/OpenVidu/Session.ts index edf92a77..4dffbaeb 100644 --- a/openvidu-browser/src/OpenVidu/Session.ts +++ b/openvidu-browser/src/OpenVidu/Session.ts @@ -109,10 +109,10 @@ export class Session implements EventDispatcher { /** * Connects to the session using `token`. Parameter `metadata` allows you to pass extra data to share with other users when - * they receive `streamCreated` event. The structure of `metadata` string is up to you (maybe some standarized format + * they receive `streamCreated` event. The structure of `metadata` string is up to you (maybe some standardized format * as JSON or XML is a good idea), the only restriction is a maximum length of 10000 chars. * - * This metadata is not considered secure, as it is generated in the client side. To pass securized data, add it as a parameter in the + * This metadata is not considered secure, as it is generated in the client side. To pass secure data, add it as a parameter in the * token generation operation (through the API REST, openvidu-java-client or openvidu-node-client). * * Only after the returned Promise is successfully resolved [[Session.connection]] object will be available and properly defined. @@ -612,7 +612,7 @@ export class Session implements EventDispatcher { if (type === 'publisherStartSpeaking' || type === 'publisherStopSpeaking') { this.speakingEventsEnabled = false; - // If there are already available remote streams, disablae hark in all of them + // If there are already available remote streams, disable hark in all of them for (const connectionId in this.remoteConnections) { const str = this.remoteConnections[connectionId].stream; if (!!str && !!str.speechEvent) { diff --git a/openvidu-browser/src/OpenVidu/Stream.ts b/openvidu-browser/src/OpenVidu/Stream.ts index c217d19c..57cf8558 100644 --- a/openvidu-browser/src/OpenVidu/Stream.ts +++ b/openvidu-browser/src/OpenVidu/Stream.ts @@ -259,7 +259,6 @@ export class Stream implements EventDispatcher { /** - * * Applies an audio/video filter to the stream. * * @param type Type of filter applied. See [[Filter.type]] diff --git a/openvidu-server/src/main/java/io/openvidu/server/rpc/RpcHandler.java b/openvidu-server/src/main/java/io/openvidu/server/rpc/RpcHandler.java index 3346392e..adf1bbb7 100644 --- a/openvidu-server/src/main/java/io/openvidu/server/rpc/RpcHandler.java +++ b/openvidu-server/src/main/java/io/openvidu/server/rpc/RpcHandler.java @@ -369,7 +369,6 @@ public class RpcHandler extends DefaultJsonRpcHandler { throw new OpenViduException(Code.USER_UNAUTHORIZED_ERROR_CODE, "Unable to force unpublish. The user does not have a valid token"); } - } private void applyFilter(RpcConnection rpcConnection, Request request) { diff --git a/openvidu-testapp/src/app/components/dialogs/filter-dialog/filter-dialog.component.ts b/openvidu-testapp/src/app/components/dialogs/filter-dialog/filter-dialog.component.ts index 208bb763..ec1818fb 100644 --- a/openvidu-testapp/src/app/components/dialogs/filter-dialog/filter-dialog.component.ts +++ b/openvidu-testapp/src/app/components/dialogs/filter-dialog/filter-dialog.component.ts @@ -54,6 +54,7 @@ export class FilterDialogComponent { }); } else { console.warn('No filter applied to stream ' + this.stream.streamId); + this.response = 'Error [Stream ' + this.stream.streamId + ' has no filter applied in session]'; } } @@ -70,26 +71,34 @@ export class FilterDialogComponent { subFilterEvent() { console.log('Adding filter event'); - this.stream.filter.addEventListener(this.eventType, (event: FilterEvent) => { - this.filterEventHandler(event); - }) - .then(() => { - this.response = 'Filter event listener added'; + if (!!this.stream.filter) { + this.stream.filter.addEventListener(this.eventType, (event: FilterEvent) => { + this.filterEventHandler(event); }) - .catch(error => { - this.response = 'Error [' + error.message + ']'; - }); + .then(() => { + this.response = 'Filter event listener added'; + }) + .catch(error => { + this.response = 'Error [' + error.message + ']'; + }); + } else { + this.response = 'Error [Stream ' + this.stream.streamId + ' has no filter applied in session]'; + } } unsubFilterEvent() { console.log('Removing filter event'); - this.stream.filter.removeEventListener(this.eventType) - .then(() => { - this.response = 'Filter event listener removed'; - }) - .catch(error => { - this.response = 'Error [' + error.message + ']'; - }); + if (!!this.stream.filter) { + this.stream.filter.removeEventListener(this.eventType) + .then(() => { + this.response = 'Filter event listener removed'; + }) + .catch(error => { + this.response = 'Error [' + error.message + ']'; + }); + } else { + this.response = 'Error [Stream ' + this.stream.streamId + ' has no filter applied in session]'; + } } }