mirror of https://github.com/OpenVidu/openvidu.git
openvidu-browser: minor updates in NetworkQualityLevelChangedEvent
parent
b4c1df1878
commit
47f090b2cb
|
@ -71,6 +71,7 @@ const platform: PlatformUtils = PlatformUtils.getInstance();
|
||||||
* - signal ([[SignalEvent]])
|
* - signal ([[SignalEvent]])
|
||||||
* - recordingStarted ([[RecordingEvent]])
|
* - recordingStarted ([[RecordingEvent]])
|
||||||
* - recordingStopped ([[RecordingEvent]])
|
* - recordingStopped ([[RecordingEvent]])
|
||||||
|
* - networkQualityLevelChanged ([[NetworkQualityLevelChangedEvent]])
|
||||||
* - reconnecting
|
* - reconnecting
|
||||||
* - reconnected
|
* - reconnected
|
||||||
*
|
*
|
||||||
|
@ -935,8 +936,12 @@ export class Session extends EventDispatcher {
|
||||||
if (msg.connectionId === this.connection.connectionId) {
|
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.qualityLevel, this.connection)]);
|
||||||
} else {
|
} else {
|
||||||
this.getConnection(msg.connectionId, 'Connection not found for connectionId ' + msg.connectionId).then((connection: Connection) => {
|
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.qualityLevel, connection)]);
|
||||||
|
})
|
||||||
|
.catch(openViduError => {
|
||||||
|
logger.error(openViduError);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Event } from './Event';
|
import { Event } from './Event';
|
||||||
import { Stream } from '../../OpenVidu/Stream';
|
|
||||||
import { Filter } from '../../OpenVidu/Filter';
|
import { Filter } from '../../OpenVidu/Filter';
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,22 +20,25 @@ import { Session } from '../../OpenVidu/Session';
|
||||||
import { Connection } from '../../OpenVidu/Connection';
|
import { Connection } from '../../OpenVidu/Connection';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines event `networkQualityLevelChangedEvent` dispatched by [[Session]].
|
* Defines event `networkQualityLevelChanged` dispatched by [[Session]].
|
||||||
* This event is fired when the network quality of the local connection changes
|
* This event is fired when the network quality level of a [[Connection]] changes.
|
||||||
*/
|
*/
|
||||||
export class NetworkQualityLevelChangedEvent extends Event {
|
export class NetworkQualityLevelChangedEvent extends Event {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* New value of the network quality level
|
||||||
|
*/
|
||||||
|
qualityLevel: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* New value of the property (after change, current value)
|
* Connection for whom the network quality level changed
|
||||||
*/
|
*/
|
||||||
qualityLevel: Object;
|
|
||||||
connection: Connection
|
connection: Connection
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @hidden
|
* @hidden
|
||||||
*/
|
*/
|
||||||
constructor(target: Session, qualityLevel: Object, connection: Connection) {
|
constructor(target: Session, qualityLevel: number, connection: Connection) {
|
||||||
super(false, target, 'networkQualityLevelChanged');
|
super(false, target, 'networkQualityLevelChanged');
|
||||||
this.qualityLevel = qualityLevel;
|
this.qualityLevel = qualityLevel;
|
||||||
this.connection = connection;
|
this.connection = connection;
|
||||||
|
|
Loading…
Reference in New Issue