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]])
|
||||
* - recordingStarted ([[RecordingEvent]])
|
||||
* - recordingStopped ([[RecordingEvent]])
|
||||
* - networkQualityLevelChanged ([[NetworkQualityLevelChangedEvent]])
|
||||
* - reconnecting
|
||||
* - reconnected
|
||||
*
|
||||
|
@ -935,8 +936,12 @@ export class Session extends EventDispatcher {
|
|||
if (msg.connectionId === this.connection.connectionId) {
|
||||
this.ee.emitEvent('networkQualityLevelChanged', [new NetworkQualityLevelChangedEvent(this, msg.qualityLevel, this.connection)]);
|
||||
} 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)]);
|
||||
})
|
||||
.catch(openViduError => {
|
||||
logger.error(openViduError);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1135,7 +1140,7 @@ export class Session extends EventDispatcher {
|
|||
}
|
||||
|
||||
sendVideoData(streamManager: StreamManager, intervalSeconds: number = 1) {
|
||||
if(
|
||||
if (
|
||||
platform.isChromeBrowser() || platform.isChromeMobileBrowser() || platform.isOperaBrowser() ||
|
||||
platform.isOperaMobileBrowser() || platform.isElectron() || (platform.isSafariBrowser() && !platform.isIonicIos()) ||
|
||||
platform.isAndroidBrowser() || platform.isSamsungBrowser() || platform.isIonicAndroid() ||
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
*/
|
||||
|
||||
import { Event } from './Event';
|
||||
import { Stream } from '../../OpenVidu/Stream';
|
||||
import { Filter } from '../../OpenVidu/Filter';
|
||||
|
||||
|
||||
|
|
|
@ -20,22 +20,25 @@ import { Session } from '../../OpenVidu/Session';
|
|||
import { Connection } from '../../OpenVidu/Connection';
|
||||
|
||||
/**
|
||||
* Defines event `networkQualityLevelChangedEvent` dispatched by [[Session]].
|
||||
* This event is fired when the network quality of the local connection changes
|
||||
* Defines event `networkQualityLevelChanged` dispatched by [[Session]].
|
||||
* This event is fired when the network quality level of a [[Connection]] changes.
|
||||
*/
|
||||
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
|
||||
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
constructor(target: Session, qualityLevel: Object, connection: Connection) {
|
||||
constructor(target: Session, qualityLevel: number, connection: Connection) {
|
||||
super(false, target, 'networkQualityLevelChanged');
|
||||
this.qualityLevel = qualityLevel;
|
||||
this.connection = connection;
|
||||
|
|
Loading…
Reference in New Issue