Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!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">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
html { overflow:hidden }
body { margin:0 }
::cue {
font-family: Ahem, sans-serif;
color: green
}
</style>
<script src="/common/reftest-wait.js"></script>
<script>
var i = 0;
function updateCue() {
i++;
if (i !== 2) {
return;
}
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();
takeScreenshotDelayed(1000);
};
v.play();
}
</script>
<video id="video" width="320" height="180" 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" onload="updateCue();">
<script>
document.getElementsByTagName('track')[0].track.mode = 'showing';
</script>
</video>
</html>