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"> | 4 <script type="text/javascript"> |
5 $ = function(id) { | 5 $ = function(id) { |
6 return document.getElementById(id); | 6 return document.getElementById(id); |
7 }; | 7 }; |
8 | 8 |
9 setAllEventsOccuredHandler(function() { | 9 setAllEventsOccuredHandler(function() { |
10 reportTestSuccess(); | 10 reportTestSuccess(); |
11 }); | 11 }); |
12 | 12 |
13 function getSources() { | 13 function getSources() { |
14 MediaStreamTrack.getSources(function(devices) { | 14 MediaStreamTrack.getSources(function(devices) { |
15 document.title = 'Media devices available'; | 15 document.title = 'Media devices available'; |
16 sendValueToTest(JSON.stringify(devices)); | 16 var results = []; |
| 17 for (var device, i = 0; device = devices[i]; ++i) { |
| 18 results.push({ |
| 19 'id': device.id, |
| 20 'kind': device.kind, |
| 21 'label': device.label, |
| 22 'facing': device.facing |
| 23 }); |
| 24 } |
| 25 sendValueToTest(JSON.stringify(results)); |
17 }); | 26 }); |
18 } | 27 } |
19 | 28 |
20 // Creates a MediaStream and renders it locally. When the video is detected to | 29 // Creates a MediaStream and renders it locally. When the video is detected to |
21 // be rolling, the stream should be stopped. | 30 // be rolling, the stream should be stopped. |
22 function getUserMediaAndStop(constraints) { | 31 function getUserMediaAndStop(constraints) { |
23 console.log('Calling getUserMediaAndStop.'); | 32 console.log('Calling getUserMediaAndStop.'); |
24 navigator.webkitGetUserMedia( | 33 navigator.webkitGetUserMedia( |
25 constraints, | 34 constraints, |
26 function(stream) { | 35 function(stream) { |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 </tr> | 472 </tr> |
464 <tr> | 473 <tr> |
465 <td><video id="local-view-2" width="320" height="240" autoplay | 474 <td><video id="local-view-2" width="320" height="240" autoplay |
466 style="display:none"></video></td> | 475 style="display:none"></video></td> |
467 <td><canvas id="local-view-2-canvas" width="320" height="240" | 476 <td><canvas id="local-view-2-canvas" width="320" height="240" |
468 style="display:none"></canvas></td> | 477 style="display:none"></canvas></td> |
469 </tr> | 478 </tr> |
470 </table> | 479 </table> |
471 </body> | 480 </body> |
472 </html> | 481 </html> |
OLD | NEW |