Skip to content
Snippets Groups Projects
Commit a3c7e061 authored by Robert Swain's avatar Robert Swain
Browse files

webrtc/call: Add backward compatibility with webkitMediaStream

parent b4981fa2
No related branches found
No related tags found
No related merge requests found
...@@ -600,7 +600,7 @@ MatrixCall.prototype._maybeGotUserMediaForInvite = function(stream) { ...@@ -600,7 +600,7 @@ MatrixCall.prototype._maybeGotUserMediaForInvite = function(stream) {
'OfferToReceiveVideo': self.type === 'video', 'OfferToReceiveVideo': self.type === 'video',
}, },
}; };
if (stream instanceof MediaStream) { if (stream instanceof this.webRtc.MediaStream) {
const videoEl = this.getLocalVideoElement(); const videoEl = this.getLocalVideoElement();
if (videoEl && this.type == 'video') { if (videoEl && this.type == 'video') {
...@@ -661,7 +661,7 @@ MatrixCall.prototype._maybeGotUserMediaForAnswer = function(stream) { ...@@ -661,7 +661,7 @@ MatrixCall.prototype._maybeGotUserMediaForAnswer = function(stream) {
} }
const error = stream; const error = stream;
if (stream instanceof MediaStream) { if (stream instanceof this.webRtc.MediaStream) {
const localVidEl = self.getLocalVideoElement(); const localVidEl = self.getLocalVideoElement();
if (localVidEl && self.type == 'video') { if (localVidEl && self.type == 'video') {
...@@ -1362,6 +1362,9 @@ module.exports.createNewMatrixCall = function(client, roomId, options) { ...@@ -1362,6 +1362,9 @@ module.exports.createNewMatrixCall = function(client, roomId, options) {
webRtc.RtcIceCandidate = ( webRtc.RtcIceCandidate = (
w.RTCIceCandidate || w.webkitRTCIceCandidate || w.mozRTCIceCandidate w.RTCIceCandidate || w.webkitRTCIceCandidate || w.mozRTCIceCandidate
); );
webRtc.MediaStream = (
w.MediaStream || w.webkitMediaStream
);
webRtc.vendor = null; webRtc.vendor = null;
if (w.mozRTCPeerConnection) { if (w.mozRTCPeerConnection) {
webRtc.vendor = "mozilla"; webRtc.vendor = "mozilla";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment