Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(467)

Side by Side Diff: content/test/data/media/getusermedia.html

Issue 2481263004: Revert of Remove MediaStreamTrack.getSources(). (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 navigator.mediaDevices.enumerateDevices().then(function(devices) { 14 MediaStreamTrack.getSources(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;
20 results.push({ 18 results.push({
21 'id': device.deviceId, 19 'id': device.id,
22 'kind': device.kind == "audioinput" ? "audio" : "video", 20 'kind': device.kind,
23 'label': device.label, 21 'label': device.label,
24 'facing': "" 22 'facing': device.facing
25 }); 23 });
26 } 24 }
27 sendValueToTest(JSON.stringify(results)); 25 sendValueToTest(JSON.stringify(results));
28 }); 26 });
29 } 27 }
30 28
31 // 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
32 // be rolling, the stream should be stopped. 30 // be rolling, the stream should be stopped.
33 function getUserMediaAndStop(constraints) { 31 function getUserMediaAndStop(constraints) {
34 console.log('Calling getUserMediaAndStop. constraints : ' + 32 console.log('Calling getUserMediaAndStop. constraints : ' +
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 </tr> 540 </tr>
543 <tr> 541 <tr>
544 <td><video id="local-view-2" width="320" height="240" autoplay 542 <td><video id="local-view-2" width="320" height="240" autoplay
545 style="display:none"></video></td> 543 style="display:none"></video></td>
546 <td><canvas id="local-view-2-canvas" width="320" height="240" 544 <td><canvas id="local-view-2-canvas" width="320" height="240"
547 style="display:none"></canvas></td> 545 style="display:none"></canvas></td>
548 </tr> 546 </tr>
549 </table> 547 </table>
550 </body> 548 </body>
551 </html> 549 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698