fix #8: use ontrack instead of onaddstream
parent
9147238b49
commit
58cc73cf41
|
|
@ -1 +1,2 @@
|
|||
node_modules
|
||||
npm-debug.log
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ function getUserMediaSuccess(stream) {
|
|||
function start(isCaller) {
|
||||
peerConnection = new RTCPeerConnection(peerConnectionConfig);
|
||||
peerConnection.onicecandidate = gotIceCandidate;
|
||||
peerConnection.onaddstream = gotRemoteStream;
|
||||
peerConnection.ontrack = gotRemoteStream;
|
||||
peerConnection.addStream(localStream);
|
||||
|
||||
if(isCaller) {
|
||||
|
|
@ -85,7 +85,7 @@ function createdDescription(description) {
|
|||
|
||||
function gotRemoteStream(event) {
|
||||
console.log('got remote stream');
|
||||
remoteVideo.srcObject = event.stream;
|
||||
remoteVideo.srcObject = event.streams[0];
|
||||
}
|
||||
|
||||
function errorHandler(error) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue