diff --git a/openvidu-browser/src/OpenVidu/Session.ts b/openvidu-browser/src/OpenVidu/Session.ts index c83eea6c..95b9de7c 100644 --- a/openvidu-browser/src/OpenVidu/Session.ts +++ b/openvidu-browser/src/OpenVidu/Session.ts @@ -957,11 +957,11 @@ export class Session extends EventDispatcher { */ onNetworkQualityLevelChangedChanged(msg): void { if (msg.connectionId === this.connection.connectionId) { - this.ee.emitEvent('networkQualityLevelChanged', [new NetworkQualityLevelChangedEvent(this, msg.qualityLevel, this.connection)]); + this.ee.emitEvent('networkQualityLevelChanged', [new NetworkQualityLevelChangedEvent(this, msg.newValue, msg.oldValue, this.connection)]); } else { this.getConnection(msg.connectionId, 'Connection not found for connectionId ' + msg.connectionId) .then((connection: Connection) => { - this.ee.emitEvent('networkQualityLevelChanged', [new NetworkQualityLevelChangedEvent(this, msg.qualityLevel, connection)]); + this.ee.emitEvent('networkQualityLevelChanged', [new NetworkQualityLevelChangedEvent(this, msg.newValue, msg.oldValue, connection)]); }) .catch(openViduError => { logger.error(openViduError); diff --git a/openvidu-browser/src/OpenViduInternal/Events/NetworkQualityLevelChangedEvent.ts b/openvidu-browser/src/OpenViduInternal/Events/NetworkQualityLevelChangedEvent.ts index 0dbfdc95..592e62a7 100644 --- a/openvidu-browser/src/OpenViduInternal/Events/NetworkQualityLevelChangedEvent.ts +++ b/openvidu-browser/src/OpenViduInternal/Events/NetworkQualityLevelChangedEvent.ts @@ -30,7 +30,12 @@ export class NetworkQualityLevelChangedEvent extends Event { /** * New value of the network quality level */ - qualityLevel: number; + newValue: number; + + /** + * Old value of the network quality level + */ + oldValue: number; /** * Connection for whom the network quality level changed @@ -40,9 +45,10 @@ export class NetworkQualityLevelChangedEvent extends Event { /** * @hidden */ - constructor(target: Session, qualityLevel: number, connection: Connection) { + constructor(target: Session, newValue: number, oldValue: number, connection: Connection) { super(false, target, 'networkQualityLevelChanged'); - this.qualityLevel = qualityLevel; + this.newValue = newValue; + this.oldValue = oldValue; this.connection = connection; } diff --git a/openvidu-client/src/main/java/io/openvidu/client/internal/ProtocolElements.java b/openvidu-client/src/main/java/io/openvidu/client/internal/ProtocolElements.java index f347c2cf..1638425d 100644 --- a/openvidu-client/src/main/java/io/openvidu/client/internal/ProtocolElements.java +++ b/openvidu-client/src/main/java/io/openvidu/client/internal/ProtocolElements.java @@ -99,7 +99,8 @@ public class ProtocolElements { public static final String NETWORKQUALITYLEVELCHANGED_METHOD = "networkQualityLevelChanged"; public static final String NETWORKQUALITYCHANGED_CONNECTIONID_PARAM = "connectionId"; - public static final String NETWORKQUALITYCHANGED_QUALITYLEVEL_PARAM = "qualityLevel"; + public static final String NETWORKQUALITYCHANGED_NEWVALUE_PARAM = "newValue"; + public static final String NETWORKQUALITYCHANGED_OLDVALUE_PARAM = "oldValue"; public static final String FORCEDISCONNECT_METHOD = "forceDisconnect"; public static final String FORCEDISCONNECT_CONNECTIONID_PARAM = "connectionId";