fix html
This commit is contained in:
parent
a6c6f248c3
commit
a72a63a218
34
index.html
34
index.html
|
@ -19,20 +19,24 @@ h2 {
|
|||
}
|
||||
|
||||
#left {
|
||||
float:left;
|
||||
|
||||
width: 550px;
|
||||
}
|
||||
#example {
|
||||
padding-top: 56px;
|
||||
position: absolute;
|
||||
top: 56px;
|
||||
left: 550px;
|
||||
}
|
||||
code {
|
||||
background-color: #eee;
|
||||
width: 580px;
|
||||
}
|
||||
.srt {
|
||||
font-size: 16px;
|
||||
padding-left: 550px;
|
||||
position: absolute;
|
||||
top: 310px;
|
||||
left: 0px;
|
||||
width: 512px;
|
||||
font-size: 16px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
@ -42,30 +46,32 @@ code {
|
|||
<p>
|
||||
<h2>jquery.srt.js</h2>
|
||||
<p>
|
||||
play srt subtitles together with your <video> element
|
||||
play srt subtitles next to your <video> element
|
||||
</p>
|
||||
<p>
|
||||
<b>Example:</b>
|
||||
<pre><code>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="jquery.srt.js"></script>
|
||||
|
||||
<video src="http://example.com/video.ogv" id="video" controls>
|
||||
<div class="srt" data-video="video"
|
||||
data-srt="http://example.com/video.srt" />
|
||||
<div class="srt"
|
||||
data-video="video"
|
||||
data-srt="http://example.com/video.srt" />
|
||||
</code></pre>
|
||||
jquery.srt.js will try to load subtitles in all elements with 'srt' class.<br>
|
||||
'data-video' atribute is used to link to the related video,<br>
|
||||
if not data-srt is provided, the contents of the div is parsed as srt.
|
||||
if no data-srt is provided, the contents of the div is parsed as srt.
|
||||
</p>
|
||||
<p>
|
||||
<b>Download:</b> <a href="jquery.srt.js">jquery.srt.js</a>
|
||||
</p>
|
||||
</div>
|
||||
<div id="example">
|
||||
<p>
|
||||
<video src="http://footage.stealthisfilm.com/stream/Robert%20Darnton%20-%20Two%20Information%20Systems%20at%20War%2C%20in%2018th%20Century%20France.ogg" id="video" autplay controls>
|
||||
</p>
|
||||
<div class="srt" data-video="video" data-srt="sample.srt">
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<video src="http://footage.stealthisfilm.com/stream/Robert%20Darnton%20-%20Two%20Information%20Systems%20at%20War%2C%20in%2018th%20Century%20France.ogg" id="video" autplay controls></video>
|
||||
</p>
|
||||
<div class="srt" data-video="video" data-srt="sample.srt">content</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -9,12 +9,12 @@
|
|||
*/
|
||||
/*
|
||||
usage:
|
||||
<video src="myvideo.ogg" id="myvideo" />
|
||||
<div id="subtitles" class="srt" data-video="myvideo" data-srt="myvideo.srt"></div>
|
||||
<video src="example.ogg" id="examplevideo" />
|
||||
<div class="srt" data-video="examplevideo" data-srt="example.srt"></div>
|
||||
|
||||
all elements with class 'srt' that have a data-video atribute,
|
||||
referencing the related video, if not data-srt is provided,
|
||||
the contents of the div is parsed as srt.
|
||||
jquery.srt.js will try to load subtitles in all elements with 'srt' class.
|
||||
'data-video' atribute is used to link to the related video,
|
||||
if no data-srt is provided, the contents of the div is parsed as srt.
|
||||
*/
|
||||
|
||||
$(document).ready(function() {
|
||||
|
@ -57,8 +57,8 @@ $(document).ready(function() {
|
|||
}
|
||||
var currentSubtitle = -1;
|
||||
var ival = setInterval(function() {
|
||||
currentTime = document.getElementById(videoId).currentTime;
|
||||
subtitle = -1;
|
||||
var currentTime = document.getElementById(videoId).currentTime;
|
||||
var subtitle = -1;
|
||||
for(s in subtitles) {
|
||||
if(s > currentTime)
|
||||
break
|
||||
|
|
Loading…
Reference in New Issue
Block a user