-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
50 lines (45 loc) · 2.24 KB
/
index.html
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
44
45
46
47
48
49
50
<!DOCTYPE html>
<html>
<head>
<title>HTML5 Video Closed Captioning Example</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" media="screen" href="css/captions.css"/>
</head>
<body>
<h1>HTML5 Video Closed Captioning Example</h1>
<video controls autobuffer id="videoTest" width="1010" height="464">
<source src="video/arduino.m4v" type="video/mp4" />
<source src="video/arduino.webm" type="video/webm" />
<source src="video/arduino.ogv" type="video/ogg" />
<!-- Subtitles for this video -->
<track kind="subtitles" src="video/arduino-en.vtt" type="text/vtt" srclang="en" label="English Subtitles" />
<track kind="subtitles" src="video/arduino-de.vtt" type="text/vtt" srclang="de" label="German Subtitles" />
<track kind="subtitles" src="video/arduino-ja.vtt" type="text/vtt" srclang="ja" label="Japanese Subtitles" />
<!-- WebVTT Testing & Examples -->
<track kind="captions" src="video/acid.vtt" type="text/vtt" srclang="en" label="WebVTT Acid Test" />
<track kind="captions" src="video/example.vtt" type="text/vtt" srclang="en" label="WHATWG's WebVTT Example" default />
</video>
<h2>Media Controls</h2>
<!-- Include Caption Renderer -->
<script type="text/javascript" src="/Ayamel/TimedText/TimedText.js"></script>
<script type="text/javascript" src="/Ayamel/TimedText/WebVTTnew.js"></script>
<script type="text/javascript" src="/Ayamel/TimedText/TextTrack.js"></script>
<script type="text/javascript" src="/Ayamel/TimedText/TextTrackCue.js"></script>
<script type="text/javascript" src="js/caption-renderer.js"></script>
<!-- Example Usage -->
<script type="text/javascript" src="js/captionator-example-api.js"></script>
<script type="text/javascript">
window.addEventListener("load",function() {
var videoObject = document.getElementById("videoTest");
var renderer = CaptionRenderer(videoObject,{
sizeCuesByTextBoundingBox: !!window.location.search.match(/boundingBox/i),
preprocess: function(str){ return str; },
styleCue: function(cue,DOMNode){ return DOMNode; }
});
renderer.processVideoElement(videoObject);
renderer.bindMediaElement(videoObject);
document.body.appendChild(generateMediaControls(renderer));
},false);
</script>
</body>
</html>