-
Notifications
You must be signed in to change notification settings - Fork 22
/
example.html
61 lines (55 loc) · 1.79 KB
/
example.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
51
52
53
54
55
56
57
58
59
60
61
<!DOCTYPE html>
<html>
<head>
<title>Videojs ASS/SSA subtitles</title>
<!-- npm -->
<link href="node_modules/video.js/dist/video-js.min.css" rel="stylesheet">
<link href="node_modules/libjass/libjass.css" rel="stylesheet">
<script src="node_modules/video.js/dist/video.min.js"></script>
<script src="node_modules/libjass/libjass.js"></script>
<!-- bower-->
<!--
<link href="bower_components/videojs/dist/video-js.min.css" rel="stylesheet">
<link href="bower_components/libjass/libjass.css" rel="stylesheet">
<script src="bower_components/videojs/dist/video.min.js"></script>
<script src="bower_components/libjass/libjass.js"></script>
-->
<!-- src -->
<link href="src/videojs.ass.css" rel="stylesheet">
<script src="src/videojs.ass.js"></script>
</head>
<body>
<video id="player" class="video-js vjs-default-skin vjs-big-play-centered">
<source src="video/os.mp4" type="video/mp4">
</video>
<script>
videojs('player', {
controls: true,
nativeControlsForTouch: false,
width: 640,
height: 360,
// fluid: true,
// plugins: {
// ass: {
// 'src': ["subs/os.ass"],
// videoWidth: 640,
// videoHeight: 360,
// // enableSvg: false
// }
// },
playbackRates: [0.5, 1, 1.5, 2]
});
var vjs = videojs('player');
// initialize the plugin this way to access internal methods
var vjs_ass = vjs.ass({
'src': ["subs/os.ass"],
label: "engsub",
videoWidth: 640,
videoHeight: 360,
// enableSvg: false
});
// you will then be able to use the following js to switch subtitle
// vjs_ass.loadNewSubtitle('URL HERE')
</script>
</body>
</html>