[refactor] More post-NSS WebCrypto cleanups (utility functions).
[chromium-blink-merge.git] / content / test / data / media / getusermedia-real-webcam.html
blob8215c0f82a93ff83ef6bfc7d083309fc2df2a425
1 <html>
2 <head>
3 <script type="text/javascript" src="webrtc_test_utilities.js"></script>
4 <script type="text/javascript">
5 $ = function(id) {
6 return document.getElementById(id);
7 };
9 function getUserMediaAndReturnVideoDimensions(constraints) {
10 navigator.webkitGetUserMedia(
11 constraints, gotStreamCallback, failedCallback);
14 function failedCallback(error) {
15 failTest('GetUserMedia call failed with code ' + error.code);
18 function gotStreamCallback(stream) {
19 var localView = $('local-view');
20 localView.src = URL.createObjectURL(stream);
21 detectVideoPlaying('local-view', function() {
22 sendValueToTest(localView.videoWidth + 'x' + localView.videoHeight);
23 });
25 </script>
26 </head>
27 <body>
28 <table border="0">
29 <tr>
30 <td><video id="local-view" autoplay="autoplay">
31 </video></td>
32 <td><canvas id="local-view-canvas" style="display:none"></canvas></td>
33 </tr>
34 </table>
35 </body>
36 </html>