Merge pull request #375 from OpenVidu/cordova-new-version

Cordova new version
pull/391/head
Pablo Fuente Pérez 2020-01-08 16:18:48 +01:00 committed by GitHub
commit 0f90627f03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 39 deletions

View File

@ -86,15 +86,9 @@ export class WebRtcPeer {
reject('The peer connection object is in "closed" state. This is most likely due to an invocation of the dispose method before accepting in the dialogue');
}
if (!!this.configuration.mediaStream) {
if (platform['isIonicIos']) {
// iOS Ionic. LIMITATION: must use deprecated WebRTC API
const pc2: any = this.pc;
pc2.addStream(this.configuration.mediaStream);
} else {
for (const track of this.configuration.mediaStream.getTracks()) {
this.pc.addTrack(track, this.configuration.mediaStream);
}
}
resolve();
}
});
@ -112,24 +106,6 @@ export class WebRtcPeer {
}
this.remoteCandidatesQueue = [];
this.localCandidatesQueue = [];
if (platform['isIonicIos']) {
// iOS Ionic. LIMITATION: must use deprecated WebRTC API
// Stop senders deprecated
const pc1: any = this.pc;
for (const sender of pc1.getLocalStreams()) {
if (!videoSourceIsMediaStreamTrack) {
sender.stop();
}
pc1.removeStream(sender);
}
// Stop receivers deprecated
for (const receiver of pc1.getRemoteStreams()) {
if (!!receiver.track) {
receiver.stop();
}
}
} else {
// Stop senders
for (const sender of this.pc.getSenders()) {
if (!videoSourceIsMediaStreamTrack) {
@ -145,8 +121,6 @@ export class WebRtcPeer {
receiver.track.stop();
}
}
}
this.pc.close();
}
} catch (err) {