File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 15
15
Stream URL:
16
16
< input type ="text " id ="streamURL " value ="https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8 " size ="65 ">
17
17
< 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 >
18
25
19
26
<!--<script src="node_modules/video.js/dist/video.js"></script>-->
20
27
< script src ='https://vjs.zencdn.net/7.4.1/video.js '> </ script >
30
37
console . log ( "Change stream to : " + document . getElementById ( "streamURL" ) . value ) ;
31
38
player . src ( { type : "application/x-mpegURL" , src : document . getElementById ( "streamURL" ) . value } ) ;
32
39
}
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
+ }
33
50
</ script >
34
51
</ body >
35
52
</ html >
You can’t perform that action at this time.
0 commit comments