poster-12.html 990 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <!DOCTYPE HTML>
  2. <html class="reftest-wait">
  3. <!-- Test: Create video, load, play. Add poster frame, load again, poster should show. -->
  4. <script>
  5. function runTest() {
  6. var v = document.createElement('video');
  7. var endTest = function() {
  8. setTimeout(function(){document.documentElement.className = '';}, 0);
  9. };
  10. var play =
  11. function() {
  12. v.removeEventListener('loadeddata', play, false);
  13. v.play();
  14. }
  15. var addPoster = function() {
  16. v.removeEventListener('playing', addPoster,false);
  17. v.poster = "blue140x100.png";
  18. v.addEventListener('loadeddata', endTest, false);
  19. v.load();
  20. };
  21. v.addEventListener('loadeddata',
  22. play,
  23. false);
  24. v.addEventListener('playing',
  25. addPoster,
  26. false);
  27. v.id = 'v';
  28. v.src = "black140x100.webm";
  29. v.preload = "auto";
  30. document.body.appendChild(v);
  31. }
  32. </script>
  33. <body style="background:white;" onload="runTest();">
  34. </body>
  35. </html>