diff --git a/js/main.js b/js/main.js index 7ca4af7..449ea68 100644 --- a/js/main.js +++ b/js/main.js @@ -39,7 +39,9 @@ $(function() { }); peer.on('call', function(c) { + console.log('Got Called - peer:call'); c.on('stream', function(str) { + console.log('Got stream - peer.c:stream'); window.stream = str; if(!str.getVideoTracks().length) { $('.remote p').removeClass('hidden'); @@ -49,6 +51,16 @@ $(function() { }); }); + call.on('stream', function(str) { + console.log('Got stream - call:stream'); + window.stream = str; + if(!str.getVideoTracks().length) { + $('.remote p').removeClass('hidden'); + } + $('.remote video').prop('src', window.URL.createObjectURL(str)); + $('.remote video')[0].play(); + }) + con.on('open', function() { $('.connecting').addClass('hidden'); con.on('data', function(d) {