mirror of https://github.com/OpenVidu/openvidu.git
openvidu-browser: update dependencies and fix Promise return types
parent
c4ddcc952d
commit
471cbeb208
|
@ -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",
|
||||
|
|
|
@ -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<any> {
|
||||
execMethod(method: string, params: Object): Promise<void> {
|
||||
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<any> {
|
||||
addEventListener(eventType: string, handler: (event: FilterEvent) => void): Promise<void> {
|
||||
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<any> {
|
||||
removeEventListener(eventType: string): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
logger.info('Removing filter event listener to event ' + eventType + ' to stream ' + this.stream.streamId);
|
||||
this.stream.session.openvidu.sendRequest(
|
||||
|
|
|
@ -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<any> {
|
||||
record(mimeType?: string): Promise<void> {
|
||||
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<any> {
|
||||
stop(): Promise<void> {
|
||||
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<any> {
|
||||
pause(): Promise<void> {
|
||||
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<any> {
|
||||
resume(): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
if (this.state !== LocalRecorderState.PAUSED) {
|
||||
|
|
|
@ -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<any> {
|
||||
replaceTrack(track: MediaStreamTrack): Promise<void> {
|
||||
|
||||
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<any> {
|
||||
initialize(): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
let constraints: MediaStreamConstraints = {};
|
||||
|
|
|
@ -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<any> {
|
||||
connect(token: string, metadata?: any): Promise<void> {
|
||||
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<any> {
|
||||
publish(publisher: Publisher): Promise<void> {
|
||||
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<any> {
|
||||
forceDisconnect(connection: Connection): Promise<void> {
|
||||
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<any> {
|
||||
forceUnpublish(stream: Stream): Promise<void> {
|
||||
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<any> {
|
||||
signal(signal: SignalOptions): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
const signalMessage = {};
|
||||
|
@ -1225,7 +1225,7 @@ export class Session extends EventDispatcher {
|
|||
|
||||
/* Private methods */
|
||||
|
||||
private connectAux(token: string): Promise<any> {
|
||||
private connectAux(token: string): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.openvidu.startWs((error) => {
|
||||
if (!!error) {
|
||||
|
|
|
@ -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<any> {
|
||||
removeFilter(): Promise<void> {
|
||||
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<any> {
|
||||
subscribe(): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.initWebRtcPeerReceive(false)
|
||||
.then(() => {
|
||||
|
@ -443,7 +443,7 @@ export class Stream extends EventDispatcher {
|
|||
/**
|
||||
* @hidden
|
||||
*/
|
||||
publish(): Promise<any> {
|
||||
publish(): Promise<void> {
|
||||
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<any> {
|
||||
initWebRtcPeerSend(reconnect: boolean): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
if (!reconnect) {
|
||||
|
@ -908,7 +908,7 @@ export class Stream extends EventDispatcher {
|
|||
/**
|
||||
* @hidden
|
||||
*/
|
||||
initWebRtcPeerReceive(reconnect: boolean): Promise<any> {
|
||||
initWebRtcPeerReceive(reconnect: boolean): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
const offerConstraints = {
|
||||
|
|
Loading…
Reference in New Issue