Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /webvtt/rendering/cues-with-video/processing-model/enable_controls_reposition.html - WPT Dashboard Interop Dashboard
<!doctype html>
<html class="reftest-wait">
<title>WebVTT rendering, cue reposition after enabling controls</title>
<link rel="match" href="enable_controls_reposition-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
video {
width: 320px;
height: 240px;
}
::cue {
font-family: Ahem, sans-serif;
font-size: 50px;
color: green;
}
.media-container {
display: inline-block;
position: relative;
border: solid black 1px;
border-box: content-box;
width: 320px;
height: 240px;
}
</style>
<div class="media-container">
<video controls autoplay onplaying="runTest()">
<source src="/media/sound_5.mp3" type="audio/mp3">
<source src="/media/sound_5.oga" type="audio/ogg">
<track src="support/foo.vtt">
</video>
</div>
<script src="/common/reftest-wait.js"></script>
<script>
async function runTest() {
document.getElementsByTagName("track")[0].track.mode = "showing";
let media = document.getElementsByTagName("video")[0];
media.pause();
media.currentTime = 0;
media.addEventListener("seeked", (event) => {
takeScreenshot();
});
}
</script>