62 lines
1.8 KiB
HTML
62 lines
1.8 KiB
HTML
<!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>
|