mirror of https://github.com/OpenVidu/openvidu.git
commit
0f90627f03
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue