Skip to content

Commit 88e933e

Browse files
committed
Added test captions
Added test captions
1 parent 2034a4b commit 88e933e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
Stream URL:
1616
<input type="text" id="streamURL" value="https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8" size="65">
1717
<button onClick="loadStream()">Load</button>
18+
Caption1 URL:
19+
<input type="text" id="caption1URL" value="https://crackle-mediaconvert.s3.amazonaws.com/assets/thesonata/HLS/captions/thesonata_aiml.vtt" size="65">
20+
<button onClick="loadCaption1()">Load Caption</button>
21+
<br/>
22+
Caption2 URL:
23+
<input type="text" id="caption2URL" value="https://crackle-mediaconvert.s3.amazonaws.com/assets/thesonata/HLS/captions/thesonata_3play.vtt" size="65">
24+
<button onClick="loadCaption2()">Load Caption</button>
1825

1926
<!--<script src="node_modules/video.js/dist/video.js"></script>-->
2027
<script src='https://vjs.zencdn.net/7.4.1/video.js'></script>
@@ -30,6 +37,16 @@
3037
console.log("Change stream to : "+document.getElementById("streamURL").value );
3138
player.src({ type: "application/x-mpegURL", src: document.getElementById("streamURL").value });
3239
}
40+
41+
function loadCaption1(){
42+
console.log("Add caption: "+document.getElementById("caption1URL").value );
43+
player.addRemoteTextTrack({src: document.getElementById("caption1URL").value, label: 'Caption 1'}, false);
44+
}
45+
46+
function loadCaption2(){
47+
console.log("Add caption: "+document.getElementById("caption2URL").value );
48+
player.addRemoteTextTrack({src: document.getElementById("caption2URL").value, label: 'Caption 2'}, false);
49+
}
3350
</script>
3451
</body>
3552
</html>

0 commit comments

Comments
 (0)