Bug 1293015 - Call mozCapturedStreamXXX in onloadedmetadata callback. r=pehrsons.
authorChia-hung Tai <ctai@mozilla.com>
Mon, 15 Aug 2016 13:24:48 +0800
changeset 309938 bdf0c719f16d001d046cf986ef2ca4ec8732f9e9
parent 309937 82cacf7d008ad5bce4cfee7aa4006ef95407a0ae
child 309939 72dd4533b66dd7ae04189d89a667732094a74bf1
push id30575
push userryanvm@gmail.com
push dateFri, 19 Aug 2016 13:46:06 +0000
treeherdermozilla-central@3da4d64410c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspehrsons
bugs1293015
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1293015 - Call mozCapturedStreamXXX in onloadedmetadata callback. r=pehrsons. MozReview-Commit-ID: JtY28kQVOM3
dom/media/test/test_bug879717.html
--- a/dom/media/test/test_bug879717.html
+++ b/dom/media/test/test_bug879717.html
@@ -41,17 +41,16 @@ var startTest = function(media, token) {
   manager.started(token);
 
   // File playback
   var v1 = document.createElement("video");
   v1.autoplay = true;
 
   // Captured file playback
   var v2 = document.createElement("video");
-  v2.autoplay = true;
 
   // Stream playback
   var v3 = document.createElement("video");
   v3.autoplay = true;
 
   v1.gotLoadeddata = false;
   v2.gotLoadeddata = false;
   v3.gotLoadeddata = false;
@@ -115,16 +114,21 @@ var startTest = function(media, token) {
   v3.onended = onended;
 
   document.body.appendChild(v1);
   document.body.appendChild(v2);
   document.body.appendChild(v3);
 
   v1.src = media.name;
   v2.src = media.name;
-  v3.srcObject = v2.mozCaptureStreamUntilEnded();
+  v2.preload = 'metadata';
+
+  v2.addEventListener('loadedmetadata', function () {
+    v3.srcObject = v2.mozCaptureStreamUntilEnded();
+    v2.play();
+  });
 }
 
 manager.runTests(getPlayableVideos(gSmallTests), startTest);
 </script>
 </pre>
 </body>
 </html>