summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webvtt/rendering/cues-with-video/processing-model/dom_override_cue_text.html
blob: a5d1026a91cc8215e31abc6b7f507ce61fa4bb04 (plain)
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
<!DOCTYPE html>
<html class="reftest-wait">
<title>WebVTT rendering, it is possible to override cue text with the DOM APIs</title>
<link rel="match" href="dom_override_cue_text-ref.html">
<style>
html { overflow:hidden }
body { margin:0 }
::cue {
    font-family: Ahem, sans-serif;
    color: green
}
</style>
<script src="/common/reftest-wait.js"></script>
<script>
    function updateCue() {
        var t = document.getElementById('track');
        var c = t.track.cues[0];
        c.text = 'f o o';
        updateRendering();
    }
    function updateRendering() {
        var v = document.getElementById('video');
        v.onplaying = function() {
            this.onplaying = null;
            this.pause();
            takeScreenshot();
        };
        v.play();
    }
</script>
<video id="video" width="1280" height="720" autoplay onplaying="this.onplaying = null; this.pause(); updateCue();">
    <source src="/media/white.webm" type="video/webm">
    <source src="/media/white.mp4" type="video/mp4">
    <track id="track" src="support/test.vtt">
    <script>
    document.getElementsByTagName('track')[0].track.mode = 'showing';
    </script>
</video>
</html>