Bug 1291953 - Call mozCapturedStreamXXX in onloadedmetadata callback. r=pehrsons. draft
authorChia-hung Tai <ctai@mozilla.com>
Mon, 15 Aug 2016 11:43:32 +0800
changeset 401014 3c01b6e649e3ccc3c270097d82b40e780822797f
parent 401013 7ae3dcdd0b4dd8bd84da147bda5feef900035ed5
child 401025 a7eab5b0d105b0f4b8e39f7742dadbb8bd4da341
push id26334
push userbmo:ctai@mozilla.com
push dateTue, 16 Aug 2016 05:18:28 +0000
reviewerspehrsons
bugs1291953
milestone51.0a1
Bug 1291953 - Call mozCapturedStreamXXX in onloadedmetadata callback. r=pehrsons. MozReview-Commit-ID: EKFjCnn0T5q
dom/media/test/test_video_dimensions.html
--- a/dom/media/test/test_video_dimensions.html
+++ b/dom/media/test/test_video_dimensions.html
@@ -45,16 +45,18 @@ var startTest = function(test, token) {
     ok(!v.loadedmetadata, v.testName + " should only fire loadedmetadata once");
     v.loadedmetadata = true;
     ok(v.resize, v.testName +
        " resize event should have been emitted before loadedmetadata");
 
     numVideoElementsFinished += 1;
     if (v === v1) {
       removeNodeAndSource(v1);
+      vout.src = URL.createObjectURL(v2.mozCaptureStreamUntilEnded());
+      setupElement(vout, "vout");
       v2.play();
       vout.play();
     }
 
     if (numVideoElementsFinished === 3) {
       removeNodeAndSource(v2);
       removeNodeAndSource(vout);
       manager.finished(token);
@@ -71,21 +73,19 @@ var startTest = function(test, token) {
   };
 
   v1.testName = test.name;
   v2.testName = test.name + " (Captured)";
   vout.testName = test.name + " (Stream)";
 
   v1.src = test.name;
   v2.src = test.name;
-  vout.src = URL.createObjectURL(v2.mozCaptureStreamUntilEnded());
 
   setupElement(v1, "v1");
   setupElement(v2, "v2");
-  setupElement(vout, "vout");
 
   v1.play();
 };
 
 manager.runTests(getPlayableVideos(gSmallTests), startTest);
 </script>
 </pre>
 </body>