Skip to content

Commit

Permalink
add shim on _switchCamera to prevent TypeError
Browse files Browse the repository at this point in the history
  • Loading branch information
ruddell committed Feb 8, 2021
1 parent 8c0ad84 commit dbdd7ae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/react-native-webrtc-web-shim.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ window.MediaStream.prototype.release = function release() {
this.getTracks().forEach((track) => track.stop());
};

window.MediaStreamTrack.prototype._switchCamera = function switchCamera() {
console.warn('_switchCamera not implemented on web');
};

window.RTCPeerConnection.prototype.addStream = function addStream(stream) {
stream.getTracks().forEach((track) => this.addTrack(track, stream));
};
Expand Down

0 comments on commit dbdd7ae

Please sign in to comment.