Chromium Code Reviews| Index: chrome/test/data/webrtc/webrtc_video_quality_test.html |
| diff --git a/chrome/test/data/webrtc/webrtc_video_quality_test.html b/chrome/test/data/webrtc/webrtc_video_quality_test.html |
| index 258984dcf5e815d26ee345dce4652855c4f28dec..52ea50ad2e409a28151ebe64e2886b49cec02ea6 100644 |
| --- a/chrome/test/data/webrtc/webrtc_video_quality_test.html |
| +++ b/chrome/test/data/webrtc/webrtc_video_quality_test.html |
| @@ -8,8 +8,45 @@ |
| <script type="text/javascript" src="getusermedia.js"></script> |
| <script type="text/javascript" src="jsep01_call.js"></script> |
| <script type="text/javascript" src="video_extraction.js"></script> |
| + <script type="text/javascript"> |
| + // The test page will take default value if any of the parameters |
|
phoglund_chromium
2014/04/25 12:26:32
I think you can make this even smarter.
The video
|
| + // is not passed in the url. |
| + var height = 640; |
| + var width = 360; |
| + var frameRate = 30; |
| + function initialize() { |
| + var parameters = window.location.search.slice(1); |
| + var values = parameters.split('&'); |
| + for (var i = 0; i < values.length; ++i) { |
| + if (values[i].indexOf("height") == 0) |
| + height = values[i].slice(7); |
| + if (values[i].indexOf("width") == 0) |
| + width = values[i].slice(6); |
| + if (values[i].indexOf("framerate") == 0) |
| + frameRate = values[i].slice(10); |
| + } |
| + var localView = document.getElementById("local-view"); |
| + localView.height = height; |
| + localView.width = width; |
| + |
| + var remoteView = document.getElementById("remote-view"); |
| + remoteView.height = height; |
| + remoteView.width = width; |
| + remoteView.onplay = startFrameCapture(height, width, width, frameRate, 5); |
| + |
| + var remoteCanvas = document.getElementById("remote-canvas"); |
| + remoteCanvas.height = height; |
| + remoteCanvas.width = width; |
| + |
| + var outputDiv = document.getElementById("output"); |
| + outputDiv.style.display = "inline-block"; |
| + outputDiv.style.position = "relative"; |
| + outputDiv.style.width = width; |
| + outputDiv.style.height = height; |
| + } |
| + </script> |
| </head> |
| -<body> |
| +<body onload="initialize()"> |
| <table border="0"> |
| <tr> |
| <td>Local Preview</td> |
| @@ -17,8 +54,7 @@ |
| </tr> |
| <tr> |
| <td> |
| - <video width="640" height="360" id="local-view" |
| - autoplay="autoplay"></video> |
| + <video id="local-view" autoplay="autoplay"></video> |
| </td> |
| <td> |
| <!-- startFrameCapture() takes 5 parameters: |
| @@ -27,20 +63,17 @@ |
| 3. canvas_height: Height of the canvas. |
| 4. fps: fps at which we would like to sample. |
| 5. duration: The duration of the capturing. --> |
| - <video width="640" height="360" id="remote-view" |
| - autoplay="autoplay" onplay="startFrameCapture(640,360,360,30,5)"> |
| - </video> |
| + <video id="remote-view" autoplay="autoplay"></video> |
| </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td> |
| - <div id="output" style="display: inline-block; |
| - position: relative; width: 640; height: 360"> |
| + <div id="output"> |
| <!-- Canvas height should be equal to video height if we want to |
| capture the whole frames. If we only want to capture the barcode, |
| canvas height should equal the barcode height. --> |
| - <canvas id="remote-canvas" width="640" height="360"></canvas> |
| + <canvas id="remote-canvas"></canvas> |
| </div> |
| </td> |
| </tr> |