-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
40 lines (38 loc) · 1.08 KB
/
index.html
File metadata and controls
40 lines (38 loc) · 1.08 KB
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
<!DOCTYPE html>
<html>
<head>
<script>
if (window.testRunner) {
testRunner.dumpAsText()
testRunner.waitUntilDone();
}
</script>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<video src="http://localhost:8000/media/resources/hls/playlist-with-cookie.m3u8" crossorigin>
<script>
var entries = new Set();
let gotMetadata = false;
const expectedEntries = 3;
let runTest = function() {
for (let entry of performance.getEntriesByType('resource')) {
if (entries.has(entry.name))
continue;
entries.add(entry.name);
if (entries.size <= expectedEntries)
debug(entry.name);
}
if (gotMetadata && entries.size >= expectedEntries)
testRunner.notifyDone();
};
let video = document.querySelector("video");
setInterval(runTest, 100);
video.addEventListener("loadedmetadata", (e) => {
gotMetadata = true;
if (gotMetadata && entries.size >= expectedEntries)
testRunner.notifyDone();
});
</script>
</body>
</html>