From a59d1813b1022f3d86e856ac3541923be73e321d Mon Sep 17 00:00:00 2001 From: Thomas Jammet Date: Mon, 26 Feb 2024 10:10:55 +0100 Subject: [PATCH 1/5] refactor(sipconnector.ts): remove duplicate undefined check --- src/connectors/SIPConnector.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connectors/SIPConnector.ts b/src/connectors/SIPConnector.ts index 0537c54..3291cc5 100644 --- a/src/connectors/SIPConnector.ts +++ b/src/connectors/SIPConnector.ts @@ -221,7 +221,7 @@ export abstract class SIPConnector extends EventEmitter implements IConnector { } // Start the RTCPeerConnection and create an offer try { - this._peerConnection = new RTCPeerConnection(iceServer ? { iceServers: [iceServer] } : undefined); + this._peerConnection = new RTCPeerConnection({ iceServers: [iceServer] }); } catch (e) { this.close('RTCPeerConnection failed, ' + Util.stringify(e)); return; From d88befb4daac74a49690e1370385ab1a6c7adc0e Mon Sep 17 00:00:00 2001 From: Thomas Jammet Date: Mon, 26 Feb 2024 10:14:11 +0100 Subject: [PATCH 2/5] feat(adapter): get rid of webrtc-adapter Provide the essential code to support iOS and Safari without including webrtc-adapter --- README.md | 1 - examples/player-with-timed-metadata.html | 2 +- examples/player.html | 2 -- examples/streamer.html | 1 - src/connectors/SIPConnector.ts | 18 ++++++++++++++++++ 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1f18b83..73fe368 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,6 @@ import * as WebRTC from '@ceeblue/webrtc-client'; > } > } > ``` -> - To avoid potential issues with backward compatibility or problems on iOS when using `navigator.mediaDevices.getUserMedia`, we recommend including the [WebRTC adapter](https://github.com/webrtcHacks/adapter) in the final project. This often mitigates common compatibility issues on certain older devices. ### Publish a stream diff --git a/examples/player-with-timed-metadata.html b/examples/player-with-timed-metadata.html index b2dd27d..85ba19f 100644 --- a/examples/player-with-timed-metadata.html +++ b/examples/player-with-timed-metadata.html @@ -21,7 +21,7 @@

WebRTC Client Timed Metadata Player Example

-