Ionic IOS test

pull/375/head
pabloFuente 2019-09-19 16:23:47 +02:00
parent 1462123fb5
commit 53550e96f9
2 changed files with 9 additions and 9 deletions

View File

@ -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) {

View File

@ -86,15 +86,15 @@ 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']) { /*if (platform['isIonicIos']) {
// iOS Ionic. LIMITATION: must use deprecated WebRTC API // iOS Ionic. LIMITATION: must use deprecated WebRTC API
const pc2: any = this.pc; const pc2: any = this.pc;
pc2.addStream(this.configuration.mediaStream); pc2.addStream(this.configuration.mediaStream);
} else { } 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();
} }
}); });
@ -113,7 +113,7 @@ export class WebRtcPeer {
this.remoteCandidatesQueue = []; this.remoteCandidatesQueue = [];
this.localCandidatesQueue = []; this.localCandidatesQueue = [];
if (platform['isIonicIos']) { /* if (platform['isIonicIos']) {
// iOS Ionic. LIMITATION: must use deprecated WebRTC API // iOS Ionic. LIMITATION: must use deprecated WebRTC API
// Stop senders deprecated // Stop senders deprecated
const pc1: any = this.pc; const pc1: any = this.pc;
@ -129,7 +129,7 @@ export class WebRtcPeer {
receiver.stop(); receiver.stop();
} }
} }
} else { } else {*/
// Stop senders // Stop senders
for (const sender of this.pc.getSenders()) { for (const sender of this.pc.getSenders()) {
if (!videoSourceIsMediaStreamTrack) { if (!videoSourceIsMediaStreamTrack) {
@ -145,7 +145,7 @@ export class WebRtcPeer {
receiver.track.stop(); receiver.track.stop();
} }
} }
} // }
this.pc.close(); this.pc.close();
} }