| 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 navigator.mediaDevices.enumerateDevices().then(function(devices) { |
| 15 document.title = 'Media devices available'; | 15 document.title = 'Media devices available'; |
| 16 var results = []; | 16 var results = []; |
| 17 for (var device, i = 0; device = devices[i]; ++i) { | 17 for (var device, i = 0; device = devices[i]; ++i) { |
| 18 if (device.kind != "audioinput" && device.kind != "videoinput") |
| 19 continue; |
| 18 results.push({ | 20 results.push({ |
| 19 'id': device.id, | 21 'id': device.deviceId, |
| 20 'kind': device.kind, | 22 'kind': device.kind == "audioinput" ? "audio" : "video", |
| 21 'label': device.label, | 23 'label': device.label, |
| 22 'facing': device.facing | 24 'facing': "" |
| 23 }); | 25 }); |
| 24 } | 26 } |
| 25 sendValueToTest(JSON.stringify(results)); | 27 sendValueToTest(JSON.stringify(results)); |
| 26 }); | 28 }); |
| 27 } | 29 } |
| 28 | 30 |
| 29 // Creates a MediaStream and renders it locally. When the video is detected to | 31 // Creates a MediaStream and renders it locally. When the video is detected to |
| 30 // be rolling, the stream should be stopped. | 32 // be rolling, the stream should be stopped. |
| 31 function getUserMediaAndStop(constraints) { | 33 function getUserMediaAndStop(constraints) { |
| 32 console.log('Calling getUserMediaAndStop. constraints : ' + | 34 console.log('Calling getUserMediaAndStop. constraints : ' + |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 </tr> | 542 </tr> |
| 541 <tr> | 543 <tr> |
| 542 <td><video id="local-view-2" width="320" height="240" autoplay | 544 <td><video id="local-view-2" width="320" height="240" autoplay |
| 543 style="display:none"></video></td> | 545 style="display:none"></video></td> |
| 544 <td><canvas id="local-view-2-canvas" width="320" height="240" | 546 <td><canvas id="local-view-2-canvas" width="320" height="240" |
| 545 style="display:none"></canvas></td> | 547 style="display:none"></canvas></td> |
| 546 </tr> | 548 </tr> |
| 547 </table> | 549 </table> |
| 548 </body> | 550 </body> |
| 549 </html> | 551 </html> |
| OLD | NEW |