OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>MediaStream Recoder Browser Test (w/ MediaSource)</title> | 4 <title>MediaStream Recoder Browser Test (w/ MediaSource)</title> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <div> Record Real-Time video content browser test.</div> | 7 <div> Record Real-Time video content browser test.</div> |
8 <video id="video" autoplay></video> | 8 <video id="video" autoplay></video> |
9 <video id="remoteVideo" autoplay></video> | 9 <video id="remoteVideo" autoplay></video> |
10 </body> | 10 </body> |
(...skipping 24 matching lines...) Expand all Loading... |
35 console.log(e); | 35 console.log(e); |
36 reportTestSuccess(); | 36 reportTestSuccess(); |
37 } | 37 } |
38 } | 38 } |
39 | 39 |
40 // TODO(cpaulin): factor this method out of here, http://crbug.com/574503. | 40 // TODO(cpaulin): factor this method out of here, http://crbug.com/574503. |
41 function setupPeerConnection(stream) { | 41 function setupPeerConnection(stream) { |
42 return new Promise(function(resolve, reject) { | 42 return new Promise(function(resolve, reject) { |
43 var localStream = stream; | 43 var localStream = stream; |
44 var remoteStream = null; | 44 var remoteStream = null; |
45 var localPeerConnection = new webkitRTCPeerConnection(null); | 45 var localPeerConnection = new RTCPeerConnection(); |
46 var remotePeerConnection = new webkitRTCPeerConnection(null); | 46 var remotePeerConnection = new RTCPeerConnection(); |
47 | 47 |
48 function createAnswer(description) { | 48 function createAnswer(description) { |
49 remotePeerConnection.createAnswer(function(description) { | 49 remotePeerConnection.createAnswer(function(description) { |
50 remotePeerConnection.setLocalDescription(description); | 50 remotePeerConnection.setLocalDescription(description); |
51 localPeerConnection.setRemoteDescription(description); | 51 localPeerConnection.setRemoteDescription(description); |
52 }, function(error) { failTest(error.toString()); }); | 52 }, function(error) { failTest(error.toString()); }); |
53 } | 53 } |
54 | 54 |
55 localPeerConnection.onicecandidate = function(event) { | 55 localPeerConnection.onicecandidate = function(event) { |
56 if (event.candidate) { | 56 if (event.candidate) { |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 return failTest(err.toString()); | 592 return failTest(err.toString()); |
593 }) | 593 }) |
594 .then(function() { | 594 .then(function() { |
595 reportTestSuccess(); | 595 reportTestSuccess(); |
596 }); | 596 }); |
597 } | 597 } |
598 | 598 |
599 </script> | 599 </script> |
600 </body> | 600 </body> |
601 </html> | 601 </html> |
OLD | NEW |