| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script type="text/javascript" src="webrtc_test_utilities.js"></script> | 3 <script type="text/javascript" src="webrtc_test_utilities.js"></script> |
| 4 <script type="text/javascript" src="webrtc_test_audio.js"></script> | 4 <script type="text/javascript" src="webrtc_test_audio.js"></script> |
| 5 <script type="text/javascript"> | 5 <script type="text/javascript"> |
| 6 $ = function(id) { | 6 $ = function(id) { |
| 7 return document.getElementById(id); | 7 return document.getElementById(id); |
| 8 }; | 8 }; |
| 9 | 9 |
| 10 window.onerror = function(errorMsg, url, lineNumber, column, errorObj) { | 10 window.onerror = function(errorMsg, url, lineNumber, column, errorObj) { |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // pc2 to test that cloning of remote video tracks works as intended and is | 140 // pc2 to test that cloning of remote video tracks works as intended and is |
| 141 // sent back to pc1. | 141 // sent back to pc1. |
| 142 function callAndForwardRemoteStream(constraints) { | 142 function callAndForwardRemoteStream(constraints) { |
| 143 createConnections(null); | 143 createConnections(null); |
| 144 navigator.webkitGetUserMedia(constraints, | 144 navigator.webkitGetUserMedia(constraints, |
| 145 addStreamToTheFirstConnectionAndNegotiate, | 145 addStreamToTheFirstConnectionAndNegotiate, |
| 146 printGetUserMediaError); | 146 printGetUserMediaError); |
| 147 var onRemoteStream2 = function() { | 147 var onRemoteStream2 = function() { |
| 148 // Video has been detected to be playing in pc2. Clone the received | 148 // Video has been detected to be playing in pc2. Clone the received |
| 149 // stream and send it back to pc1. | 149 // stream and send it back to pc1. |
| 150 console.log('callAndForward: Adding return stream'); |
| 150 gSecondConnection.addStream(gRemoteStreams['remote-view-2'].clone()); | 151 gSecondConnection.addStream(gRemoteStreams['remote-view-2'].clone()); |
| 151 negotiate(); | 152 negotiate(); |
| 152 } | 153 } |
| 153 | 154 |
| 155 console.log('Initial setup done. Waiting.'); |
| 154 // Wait for remove video to be playing in pc2. Once video is playing, | 156 // Wait for remove video to be playing in pc2. Once video is playing, |
| 155 // forward the remove stream from pc2 to pc1. | 157 // forward the remove stream from pc2 to pc1. |
| 156 detectVideoPlaying('remote-view-2', onRemoteStream2); | 158 detectVideoPlaying('remote-view-2', onRemoteStream2); |
| 157 | 159 |
| 158 // Wait for video to be forwarded back to connection 1. | 160 // Wait for video to be forwarded back to connection 1. |
| 159 waitForVideo('remote-view-1'); | 161 waitForVideo('remote-view-1'); |
| 160 } | 162 } |
| 161 | 163 |
| 162 // First makes a call between pc1 and pc2, and then construct a new media | 164 // First makes a call between pc1 and pc2, and then construct a new media |
| 163 // stream using the remote audio and video tracks, connect the new media | 165 // stream using the remote audio and video tracks, connect the new media |
| (...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1030 <td><canvas width="320" height="240" id="remote-view-2-canvas" | 1032 <td><canvas width="320" height="240" id="remote-view-2-canvas" |
| 1031 style="display:none"></canvas></td> | 1033 style="display:none"></canvas></td> |
| 1032 <td><canvas width="320" height="240" id="remote-view-3-canvas" | 1034 <td><canvas width="320" height="240" id="remote-view-3-canvas" |
| 1033 style="display:none"></canvas></td> | 1035 style="display:none"></canvas></td> |
| 1034 <td><canvas width="320" height="240" id="remote-view-4-canvas" | 1036 <td><canvas width="320" height="240" id="remote-view-4-canvas" |
| 1035 style="display:none"></canvas></td> | 1037 style="display:none"></canvas></td> |
| 1036 </tr> | 1038 </tr> |
| 1037 </table> | 1039 </table> |
| 1038 </body> | 1040 </body> |
| 1039 </html> | 1041 </html> |
| OLD | NEW |