From 471cbeb208c6a20d8fecc1ea9ecbb934a78bb704 Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Tue, 9 Mar 2021 15:07:45 +0100 Subject: [PATCH] openvidu-browser: update dependencies and fix Promise return types --- openvidu-browser/package.json | 10 +++++----- openvidu-browser/src/OpenVidu/Filter.ts | 6 +++--- openvidu-browser/src/OpenVidu/LocalRecorder.ts | 8 ++++---- openvidu-browser/src/OpenVidu/Publisher.ts | 4 ++-- openvidu-browser/src/OpenVidu/Session.ts | 12 ++++++------ openvidu-browser/src/OpenVidu/Stream.ts | 10 +++++----- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/openvidu-browser/package.json b/openvidu-browser/package.json index f3d5bc77..a1accb17 100644 --- a/openvidu-browser/package.json +++ b/openvidu-browser/package.json @@ -4,12 +4,12 @@ "freeice": "2.2.2", "hark": "1.2.3", "platform": "1.3.6", - "uuid": "8.3.1", + "uuid": "8.3.2", "wolfy87-eventemitter": "5.2.9" }, "description": "OpenVidu Browser", "devDependencies": { - "@types/node": "14.14.7", + "@types/node": "14.14.32", "@types/platform": "1.3.3", "browserify": "17.0.0", "grunt": "1.3.0", @@ -21,11 +21,11 @@ "grunt-postcss": "0.9.0", "grunt-string-replace": "1.3.1", "grunt-ts": "6.0.0-beta.22", - "terser": "5.3.8", + "terser": "5.6.0", "tsify": "5.0.2", "tslint": "6.1.3", - "typedoc": "0.19.2", - "typescript": "4.0.5" + "typedoc": "0.20.30", + "typescript": "4.2.3" }, "license": "Apache-2.0", "main": "lib/index.js", diff --git a/openvidu-browser/src/OpenVidu/Filter.ts b/openvidu-browser/src/OpenVidu/Filter.ts index dca83879..da92e783 100644 --- a/openvidu-browser/src/OpenVidu/Filter.ts +++ b/openvidu-browser/src/OpenVidu/Filter.ts @@ -89,7 +89,7 @@ export class Filter { * @param method Name of the method * @param params Parameters of the method */ - execMethod(method: string, params: Object): Promise { + execMethod(method: string, params: Object): Promise { return new Promise((resolve, reject) => { logger.info('Executing filter method to stream ' + this.stream.streamId); let stringParams; @@ -137,7 +137,7 @@ export class Filter { * * @returns A Promise (to which you can optionally subscribe to) that is resolved if the event listener was successfully attached to the filter and rejected with an Error object if not */ - addEventListener(eventType: string, handler: (event: FilterEvent) => void): Promise { + addEventListener(eventType: string, handler: (event: FilterEvent) => void): Promise { return new Promise((resolve, reject) => { logger.info('Adding filter event listener to event ' + eventType + ' to stream ' + this.stream.streamId); this.stream.session.openvidu.sendRequest( @@ -169,7 +169,7 @@ export class Filter { * * @returns A Promise (to which you can optionally subscribe to) that is resolved if the event listener was successfully removed from the filter and rejected with an Error object in other case */ - removeEventListener(eventType: string): Promise { + removeEventListener(eventType: string): Promise { return new Promise((resolve, reject) => { logger.info('Removing filter event listener to event ' + eventType + ' to stream ' + this.stream.streamId); this.stream.session.openvidu.sendRequest( diff --git a/openvidu-browser/src/OpenVidu/LocalRecorder.ts b/openvidu-browser/src/OpenVidu/LocalRecorder.ts index 98a0bd8e..14bd2881 100644 --- a/openvidu-browser/src/OpenVidu/LocalRecorder.ts +++ b/openvidu-browser/src/OpenVidu/LocalRecorder.ts @@ -74,7 +74,7 @@ export class LocalRecorder { * * @returns A Promise (to which you can optionally subscribe to) that is resolved if the recording successfully started and rejected with an Error object if not */ - record(mimeType?: string): Promise { + record(mimeType?: string): Promise { return new Promise((resolve, reject) => { try { if (typeof MediaRecorder === 'undefined') { @@ -146,7 +146,7 @@ export class LocalRecorder { * Ends the recording of the Stream. [[state]] property must be `RECORDING` or `PAUSED`. After method succeeds is set to `FINISHED` * @returns A Promise (to which you can optionally subscribe to) that is resolved if the recording successfully stopped and rejected with an Error object if not */ - stop(): Promise { + stop(): Promise { return new Promise((resolve, reject) => { try { if (this.state === LocalRecorderState.READY || this.state === LocalRecorderState.FINISHED) { @@ -168,7 +168,7 @@ export class LocalRecorder { * Pauses the recording of the Stream. [[state]] property must be `RECORDING`. After method succeeds is set to `PAUSED` * @returns A Promise (to which you can optionally subscribe to) that is resolved if the recording was successfully paused and rejected with an Error object if not */ - pause(): Promise { + pause(): Promise { return new Promise((resolve, reject) => { try { if (this.state !== LocalRecorderState.RECORDING) { @@ -187,7 +187,7 @@ export class LocalRecorder { * Resumes the recording of the Stream. [[state]] property must be `PAUSED`. After method succeeds is set to `RECORDING` * @returns A Promise (to which you can optionally subscribe to) that is resolved if the recording was successfully resumed and rejected with an Error object if not */ - resume(): Promise { + resume(): Promise { return new Promise((resolve, reject) => { try { if (this.state !== LocalRecorderState.PAUSED) { diff --git a/openvidu-browser/src/OpenVidu/Publisher.ts b/openvidu-browser/src/OpenVidu/Publisher.ts index 136fd354..22b9f478 100644 --- a/openvidu-browser/src/OpenVidu/Publisher.ts +++ b/openvidu-browser/src/OpenVidu/Publisher.ts @@ -302,7 +302,7 @@ export class Publisher extends StreamManager { * * @returns A Promise (to which you can optionally subscribe to) that is resolved if the track was successfully replaced and rejected with an Error object in other case */ - replaceTrack(track: MediaStreamTrack): Promise { + replaceTrack(track: MediaStreamTrack): Promise { const replaceMediaStreamTrack = () => { const mediaStream: MediaStream = this.stream.displayMyRemote() ? this.stream.localMediaStreamWhenSubscribedToRemote! : this.stream.getMediaStream(); @@ -355,7 +355,7 @@ export class Publisher extends StreamManager { /** * @hidden */ - initialize(): Promise { + initialize(): Promise { return new Promise((resolve, reject) => { let constraints: MediaStreamConstraints = {}; diff --git a/openvidu-browser/src/OpenVidu/Session.ts b/openvidu-browser/src/OpenVidu/Session.ts index dc033b20..da217b86 100644 --- a/openvidu-browser/src/OpenVidu/Session.ts +++ b/openvidu-browser/src/OpenVidu/Session.ts @@ -190,7 +190,7 @@ export class Session extends EventDispatcher { * @returns A Promise to which you must subscribe that is resolved if the the connection to the Session was successful and rejected with an Error object if not * */ - connect(token: string, metadata?: any): Promise { + connect(token: string, metadata?: any): Promise { return new Promise((resolve, reject) => { this.processToken(token); @@ -383,7 +383,7 @@ export class Session extends EventDispatcher { * * @returns A Promise (to which you can optionally subscribe to) that is resolved only after the publisher was successfully published and rejected with an Error object if not */ - publish(publisher: Publisher): Promise { + publish(publisher: Publisher): Promise { return new Promise((resolve, reject) => { publisher.session = this; publisher.stream.session = this; @@ -490,7 +490,7 @@ export class Session extends EventDispatcher { * * @returns A Promise (to which you can optionally subscribe to) that is resolved only after the participant has been successfully evicted from the session and rejected with an Error object if not */ - forceDisconnect(connection: Connection): Promise { + forceDisconnect(connection: Connection): Promise { return new Promise((resolve, reject) => { logger.info('Forcing disconnect for connection ' + connection.connectionId); this.openvidu.sendRequest( @@ -529,7 +529,7 @@ export class Session extends EventDispatcher { * * @returns A Promise (to which you can optionally subscribe to) that is resolved only after the remote Stream has been successfully unpublished from the session and rejected with an Error object if not */ - forceUnpublish(stream: Stream): Promise { + forceUnpublish(stream: Stream): Promise { return new Promise((resolve, reject) => { logger.info('Forcing unpublish for stream ' + stream.streamId); this.openvidu.sendRequest( @@ -565,7 +565,7 @@ export class Session extends EventDispatcher { * mean that openvidu-server could resend the message to all the listed receivers._ */ /* tslint:disable:no-string-literal */ - signal(signal: SignalOptions): Promise { + signal(signal: SignalOptions): Promise { return new Promise((resolve, reject) => { const signalMessage = {}; @@ -1225,7 +1225,7 @@ export class Session extends EventDispatcher { /* Private methods */ - private connectAux(token: string): Promise { + private connectAux(token: string): Promise { return new Promise((resolve, reject) => { this.openvidu.startWs((error) => { if (!!error) { diff --git a/openvidu-browser/src/OpenVidu/Stream.ts b/openvidu-browser/src/OpenVidu/Stream.ts index 6fe21e18..a6627db8 100644 --- a/openvidu-browser/src/OpenVidu/Stream.ts +++ b/openvidu-browser/src/OpenVidu/Stream.ts @@ -343,7 +343,7 @@ export class Stream extends EventDispatcher { * * @returns A Promise (to which you can optionally subscribe to) that is resolved if the previously applied filter has been successfully removed and rejected with an Error object in other case */ - removeFilter(): Promise { + removeFilter(): Promise { return new Promise((resolve, reject) => { logger.info('Removing filter of stream ' + this.streamId); this.session.openvidu.sendRequest( @@ -428,7 +428,7 @@ export class Stream extends EventDispatcher { /** * @hidden */ - subscribe(): Promise { + subscribe(): Promise { return new Promise((resolve, reject) => { this.initWebRtcPeerReceive(false) .then(() => { @@ -443,7 +443,7 @@ export class Stream extends EventDispatcher { /** * @hidden */ - publish(): Promise { + publish(): Promise { return new Promise((resolve, reject) => { if (this.isLocalStreamReadyToPublish) { this.initWebRtcPeerSend(false) @@ -805,7 +805,7 @@ export class Stream extends EventDispatcher { /** * @hidden */ - initWebRtcPeerSend(reconnect: boolean): Promise { + initWebRtcPeerSend(reconnect: boolean): Promise { return new Promise((resolve, reject) => { if (!reconnect) { @@ -908,7 +908,7 @@ export class Stream extends EventDispatcher { /** * @hidden */ - initWebRtcPeerReceive(reconnect: boolean): Promise { + initWebRtcPeerReceive(reconnect: boolean): Promise { return new Promise((resolve, reject) => { const offerConstraints = {