add english subtitle

This commit is contained in:
Imanoel Ali 2019-01-17 11:35:54 +03:30
parent 203b6dabd7
commit 4768ffc21a
4 changed files with 15256 additions and 17 deletions

1
.gitignore vendored
View file

@ -1,2 +1 @@
Black.Mirror.Bandersnatch.2018.720p.WEB-DL.x264.DUAL.mkv
Black.Mirror.Bandersnatch.2018.WEBRip.x264-NoGRP.srt

File diff suppressed because it is too large Load diff

View file

@ -312,18 +312,16 @@ function togglePlayPause() {
function onload() {
var video_selector = document.getElementById("video");
var video_source_selector = document.getElementById("video-source");
var file_selector = document.getElementById("file-selector");
if (video_selector.getAttribute("src") == '') {
if (video_source_selector.getAttribute("src") == '') {
console.log('no video')
file_selector.style.display = 'table';
document.getElementById("wrapper-video").style.display = 'none';
}
document.getElementById('fileinput').addEventListener('change', function () {
var file = this.files[0];
// This code is only for demo ...
var fileUrl = URL.createObjectURL(file)
console.log(file);
console.log(fileUrl)
video_selector.src = fileUrl;
video_selector.play();
file_selector.style.display = 'none';

View file

@ -9,7 +9,9 @@
<script src="assets/SegmentMap.js"></script>
<script src="assets/scripts.js"></script>
<link rel="stylesheet" type="text/css" href="assets/styles.css">
<link </head> <body onload=onload()>
</head>
<body onload=onload()>
<div>
<div id="c">
<section role="banner">
@ -24,7 +26,10 @@
</div>
<div id="wrapper-video">
<video id="video" controls loop src="">
<video id="video" controls loop controls preload="metadata">
<source id="video-source" src="">
<track label="English" kind="subtitles" srclang="en" src="Black.Mirror.Bandersnatch.2018.WEBRip.x264-NoGRP.vtt"
default>
</video>
<div class="controls">