Browse Source

Fix bug loading video

#25 createObjectUrl() is deprecated.
Updating code with @karolkarp solution on issue #25
pull/27/head
Gildonei Mendes Anacleto Junior 6 years ago committed by GitHub
parent
commit
8be2510628
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      js/comm.js

6
js/comm.js

@ -570,8 +570,7 @@ function startCall(isCaller){
//When remote stream becomes available //When remote stream becomes available
myPC.ontrack = function(e){ myPC.ontrack = function(e){
document.getElementById("peerVid").src = window.URL.createObjectURL(e.streams[0]); document.getElementById("peerVid").srcObject = e.streams[0];
// document.getElementById("peerVid").src = window.HTMLMediaElement.srcObject(e.streams[0]);
}; };
@ -636,8 +635,7 @@ function setLocalMedia(streamConstraints, isCaller){
navigator.mediaDevices.getUserMedia( navigator.mediaDevices.getUserMedia(
streamConstraints streamConstraints
).then(function(myStream){ ).then(function(myStream){
document.getElementById("myVid").src = window.URL.createObjectURL(myStream); document.getElementById("myVid").srcObject = myStream;
// document.getElementById("peerVid").src = window.HTMLMediaElement.srcObject(e.streams[0]);
myPC.addStream(myStream);//add my stream to RTCPeerConnection myPC.addStream(myStream);//add my stream to RTCPeerConnection

Loading…
Cancel
Save