From a72a63a21879fd4678787414406f4a52e7eebe5e Mon Sep 17 00:00:00 2001
From: j
Date: Fri, 28 Nov 2008 20:53:12 +0100
Subject: [PATCH] fix html
---
index.html | 34 ++++++++++++++++++++--------------
jquery.srt.js | 14 +++++++-------
2 files changed, 27 insertions(+), 21 deletions(-)
diff --git a/index.html b/index.html
index f387eb1..7e65353 100644
--- a/index.html
+++ b/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;
}
@@ -42,30 +46,32 @@ code {
jquery.srt.js
- play srt subtitles together with your <video> element
+ play srt subtitles next to your <video> element
Example:
+<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" />
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 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.
Download: jquery.srt.js
-
-
-
-
-
+
+
+
+
content
diff --git a/jquery.srt.js b/jquery.srt.js
index 83e4675..0184732 100644
--- a/jquery.srt.js
+++ b/jquery.srt.js
@@ -9,12 +9,12 @@
*/
/*
usage:
-
-
+
+
- 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