mirror of https://github.com/OpenVidu/openvidu.git
openvidu-browser: prepare iosrtc new version
parent
53550e96f9
commit
86f288cfe2
|
@ -817,11 +817,11 @@ export class Stream implements EventDispatcher {
|
||||||
}
|
}
|
||||||
|
|
||||||
private remotePeerSuccessfullyEstablished(): void {
|
private remotePeerSuccessfullyEstablished(): void {
|
||||||
/*if (platform['isIonicIos']) {
|
if (platform['isIonicIos']) {
|
||||||
// iOS Ionic. LIMITATION: must use deprecated WebRTC API
|
// iOS Ionic. LIMITATION: must use deprecated WebRTC API
|
||||||
const pc1: any = this.webRtcPeer.pc;
|
const pc1: any = this.webRtcPeer.pc;
|
||||||
this.mediaStream = pc1.getRemoteStreams()[0];
|
this.mediaStream = pc1.getRemoteStreams()[0];
|
||||||
} else {*/
|
} else {
|
||||||
this.mediaStream = new MediaStream();
|
this.mediaStream = new MediaStream();
|
||||||
let receiver: RTCRtpReceiver;
|
let receiver: RTCRtpReceiver;
|
||||||
for (receiver of this.webRtcPeer.pc.getReceivers()) {
|
for (receiver of this.webRtcPeer.pc.getReceivers()) {
|
||||||
|
@ -829,7 +829,7 @@ export class Stream implements EventDispatcher {
|
||||||
this.mediaStream.addTrack(receiver.track);
|
this.mediaStream.addTrack(receiver.track);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// }
|
}
|
||||||
console.debug('Peer remote stream', this.mediaStream);
|
console.debug('Peer remote stream', this.mediaStream);
|
||||||
|
|
||||||
if (!!this.mediaStream) {
|
if (!!this.mediaStream) {
|
||||||
|
|
|
@ -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');
|
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 (!!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()) {
|
for (const track of this.configuration.mediaStream.getTracks()) {
|
||||||
this.pc.addTrack(track, this.configuration.mediaStream);
|
this.pc.addTrack(track, this.configuration.mediaStream);
|
||||||
}
|
}
|
||||||
// }
|
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -112,24 +106,6 @@ export class WebRtcPeer {
|
||||||
}
|
}
|
||||||
this.remoteCandidatesQueue = [];
|
this.remoteCandidatesQueue = [];
|
||||||
this.localCandidatesQueue = [];
|
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
|
// Stop senders
|
||||||
for (const sender of this.pc.getSenders()) {
|
for (const sender of this.pc.getSenders()) {
|
||||||
if (!videoSourceIsMediaStreamTrack) {
|
if (!videoSourceIsMediaStreamTrack) {
|
||||||
|
@ -145,8 +121,6 @@ export class WebRtcPeer {
|
||||||
receiver.track.stop();
|
receiver.track.stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
this.pc.close();
|
this.pc.close();
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
Loading…
Reference in New Issue