Skip to content

Commit dbdd7ae

Browse files
committed
add shim on _switchCamera to prevent TypeError
1 parent 8c0ad84 commit dbdd7ae

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/react-native-webrtc-web-shim.web.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ window.MediaStream.prototype.release = function release() {
55
this.getTracks().forEach((track) => track.stop());
66
};
77

8+
window.MediaStreamTrack.prototype._switchCamera = function switchCamera() {
9+
console.warn('_switchCamera not implemented on web');
10+
};
11+
812
window.RTCPeerConnection.prototype.addStream = function addStream(stream) {
913
stream.getTracks().forEach((track) => this.addTrack(track, stream));
1014
};

0 commit comments

Comments
 (0)