1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43

media / test / data / load_many_videos.html [blame]

<!--
Loads lots of videos to make sure that we don't deadlock somewhere
while loading lots of videos. We try a variety of video formats and
containers to try to cover different read patterns.
-->
<html>
<body onload="RunTest();">
<video controls preload=auto src="bear-320x180-hi10p.mp4?A"></video><br>
<video controls preload=auto src="bear-320x180-hi10p.mp4?B"></video><br>
<video controls preload=auto src="bear-320x180-hi10p.mp4?C"></video><br>
<video controls preload=auto src="bear-320x180-hi10p.mp4?D"></video><br>
<video controls preload=auto src="bear-320x180-hi10p.mp4?E"></video><br>
<video controls preload=auto src="bear-320x180-hi10p.mp4?F"></video><br>
<video controls preload=auto src="bear-1280x720.mp4"></video><br>
<video controls preload=auto src="bear-320x240.webm"></video><br>
<video controls preload=auto src="bear.mp4"></video><br>
<video controls preload=auto src="bear-vp8a.webm"></video><br>
<video controls preload=auto src="bear-320x240-video-only.webm"></video><br>
<video controls preload=auto src="bear-320x240-vp9_profile2.webm"></video><br>
<video controls preload=auto src="bear-320x180-hi12p-vp9.webm"></video><br>
<video controls preload=auto src="bbb-320x240-2video-2audio.mp4"></video><br>
<video controls preload=auto src="bear-1280x720-av_with-aud-nalus_frag.mp4"></video><br>
<video controls preload=auto src="bear-vp8-webvtt.webm"></video><br>
</body>

<script>
  function CheckIfDone() {
    console.log("Done?");
    var players = document.getElementsByTagName("video");
    for (var i = 0; i < players.length; i++) {
      if (players[i].readyState < 3) return;
    }
    document.title = "ENDED";
  }
  function RunTest() {
    var players = document.getElementsByTagName("video");
    for (var i = 0; i < players.length; i++) {
      players[i].addEventListener('canplay', function(e) { CheckIfDone(); });
    }
    CheckIfDone();
  }
</script>
</html>