[xiph-commits] r3968 - in itext: . javascript styles
silvia at svn.annodex.net
silvia at svn.annodex.net
Tue Jul 21 00:08:06 PDT 2009
Author: silvia
Date: 2009-07-21 00:08:06 -0700 (Tue, 21 Jul 2009)
New Revision: 3968
Modified:
itext/
itext/index.html
itext/javascript/subtitles.js
itext/styles/subtitles.css
Log:
Ripped apart the display containers for the different itext categories.
Might make sense to make different elements for those that get displayed differently...
Property changes on: itext
___________________________________________________________________
Modified: bzr:revision-info
- timestamp: 2009-07-21 05:09:49.092999935 +1000
committer: Silvia Pfeiffer <silvia.pfeiffer at vquence.com>
properties:
branch-nick: silvia
+ timestamp: 2009-07-21 07:05:10.032000065 +1000
committer: Silvia Pfeiffer <silvia.pfeiffer at vquence.com>
properties:
branch-nick: silvia
Modified: bzr:file-ids
- javascript/subtitles.js subtitles.js-20090718094218-d45036mvytq5pecp-10
+ index.html index.html-20090718094218-d45036mvytq5pecp-3
javascript/subtitles.js subtitles.js-20090718094218-d45036mvytq5pecp-10
styles/subtitles.css subtitles.css-20090718094218-d45036mvytq5pecp-13
Modified: bzr:revision-id:v4
- 1 silvia.pfeiffer at vquence.com-20090713110521-cz7evclxohf4rbs2
2 silvia.pfeiffer at vquence.com-20090714003359-apmpuor2ttarph5n
3 silvia.pfeiffer at vquence.com-20090714143931-q6j8ritt91jn5rhu
4 silvia.pfeiffer at vquence.com-20090718094222-58zgcmsg9gggbnt1
5 silvia.pfeiffer at vquence.com-20090718094708-wb83p9u6jr1xlhm6
6 silvia.pfeiffer at vquence.com-20090718095409-p6en5qufj62m8w3h
7 silvia.pfeiffer at vquence.com-20090718113424-9s8cmt1guxj6qoky
8 silvia.pfeiffer at vquence.com-20090718113445-n0q9c14w4i11pe36
9 silvia.pfeiffer at vquence.com-20090718123622-xdp52y76dvpem2ya
10 silvia.pfeiffer at vquence.com-20090718131644-69y0zml0ccbwc5er
11 silvia.pfeiffer at vquence.com-20090719002119-ekzto9pc7jqs3gw9
12 silvia.pfeiffer at vquence.com-20090719120832-srm8qemvr5jjy67w
13 silvia.pfeiffer at vquence.com-20090719130420-s7xjh35zrfj8117x
14 silvia.pfeiffer at vquence.com-20090720065454-m2g8tcjgpgw8aetr
15 silvia.pfeiffer at vquence.com-20090720131039-ivpstebztd7u3vwx
16 silvia.pfeiffer at vquence.com-20090720190949-r4ahzq2regl7opf1
+ 1 silvia.pfeiffer at vquence.com-20090713110521-cz7evclxohf4rbs2
2 silvia.pfeiffer at vquence.com-20090714003359-apmpuor2ttarph5n
3 silvia.pfeiffer at vquence.com-20090714143931-q6j8ritt91jn5rhu
4 silvia.pfeiffer at vquence.com-20090718094222-58zgcmsg9gggbnt1
5 silvia.pfeiffer at vquence.com-20090718094708-wb83p9u6jr1xlhm6
6 silvia.pfeiffer at vquence.com-20090718095409-p6en5qufj62m8w3h
7 silvia.pfeiffer at vquence.com-20090718113424-9s8cmt1guxj6qoky
8 silvia.pfeiffer at vquence.com-20090718113445-n0q9c14w4i11pe36
9 silvia.pfeiffer at vquence.com-20090718123622-xdp52y76dvpem2ya
10 silvia.pfeiffer at vquence.com-20090718131644-69y0zml0ccbwc5er
11 silvia.pfeiffer at vquence.com-20090719002119-ekzto9pc7jqs3gw9
12 silvia.pfeiffer at vquence.com-20090719120832-srm8qemvr5jjy67w
13 silvia.pfeiffer at vquence.com-20090719130420-s7xjh35zrfj8117x
14 silvia.pfeiffer at vquence.com-20090720065454-m2g8tcjgpgw8aetr
15 silvia.pfeiffer at vquence.com-20090720131039-ivpstebztd7u3vwx
16 silvia.pfeiffer at vquence.com-20090720190949-r4ahzq2regl7opf1
17 silvia.pfeiffer at vquence.com-20090720210510-i54efp8a9sem4g6g
Modified: bzr:text-parents
-
+ index.html silvia.pfeiffer at vquence.com-20090719130420-s7xjh35zrfj8117x
styles/subtitles.css silvia.pfeiffer at vquence.com-20090718094222-58zgcmsg9gggbnt1
Modified: itext/index.html
===================================================================
--- itext/index.html 2009-07-21 07:07:58 UTC (rev 3967)
+++ itext/index.html 2009-07-21 07:08:06 UTC (rev 3968)
@@ -55,7 +55,7 @@
</div></div></div>
<div class="mw"><div class="me"><div class="mc">
- <div class="captioncontainer"></div>
+ <div class="itextcontainer"></div>
<video class="v" src="elephant.ogv" poster="elephant.png" >
<!-- Language Tags http://www.iana.org/assignments/language-subtag-registry -->
Modified: itext/javascript/subtitles.js
===================================================================
--- itext/javascript/subtitles.js 2009-07-21 07:07:58 UTC (rev 3967)
+++ itext/javascript/subtitles.js 2009-07-21 07:08:06 UTC (rev 3968)
@@ -531,6 +531,35 @@
init: function(vid) {
this.video = vid;
this.load();
+ // set up display divs for each category
+ // these go in the same container:
+ // "CC": "Captions",
+ // "SUB": "Subtitles",
+ // "KTV": "Karaoke",
+ // "TRX": "Transcript",
+ // "LRC": "Lyrics",
+ // "LIN": "Linguistic Markup",
+ // these each have their own different container:
+ // "TAD": "Audio Description",
+ // "TIK": "Ticker Text",
+ // "AR": "Active Regions",
+ // "NB": "Annotation",
+ // "META": "Timed Metadata",
+ // "CUE": "Cue Points"
+ var create_cc = 0;
+ for (i in this.tracks) {
+ if (i == "CC" ||
+ i == "SUB" ||
+ i == "KTV" ||
+ i == "TRX" ||
+ i == "LRC" ||
+ i == "LIN") {
+ create_cc = 1;
+ } else {
+ $(".itextcontainer").append("<div class='itext_"+i+"></div>");
+ }
+ }
+ if (create_cc) $(".itextcontainer").append("<div class='itext_CC'></div>");
},
load: function() {
// parse the itext elements and remember which tracks to fetch
@@ -587,28 +616,58 @@
$(".catMenu").css("visibility", "hidden");
},
show: function(currentTime) {
- var content = "";
+ // get content per category
+ var content = [];
+ content["CC"] = "";
for (i in this.tracks) {
+ if (i != "CC") content[i] = "";
for (j in this.tracks[i]) {
if (this.tracks[i][j].enabled) {
if (text = this.tracks[i][j].currentText(currentTime)) {
- content += text;
+ if (i == "CC" ||
+ i == "SUB" ||
+ i == "KTV" ||
+ i == "TRX" ||
+ i == "LRC" ||
+ i == "LIN") {
+ content["CC"] += text;
+ } else {
+ content[i] += text;
+ }
}
}
}
}
- if (content) {
- // replace content of caption div
- $(".captioncontainer").html(content);
- $(".captioncontainer").css("visibility", "visible");
- // anyone with a better idea for how to place the captions bottom center, please speak up
- mc_width = $('.mc').css("width").substr(0,$('.mc').css("width").length-2)
- $(".captioncontainer").css("max-width", (mc_width-14)+"px");
- $(".captioncontainer").css("left", (mc_width/2+7)+"px");
- text_half_length = $('.text').css("width").substr(0,$('.text').css("width").length-2)/2*(-1)+"px";
- $(".captioncontainer").css("margin-left", text_half_length);
- } else {
- $(".captioncontainer").css("visibility", "hidden");
+
+ // add to correct content container
+ for (i in content) {
+ if (i == "CC" ||
+ i == "SUB" ||
+ i == "KTV" ||
+ i == "TRX" ||
+ i == "LRC" ||
+ i == "LIN") {
+ if (content["CC"]) {
+ // replace content of caption div
+ $(".itext_CC").html(content["CC"]);
+ $(".itext_CC").css("visibility", "visible");
+ // anyone with a better idea for how to place the captions bottom center, please speak up
+ mc_width = $('.mc').css("width").substr(0,$('.mc').css("width").length-2)
+ $(".itext_CC").css("max-width", (mc_width-14)+"px");
+ $(".itext_CC").css("left", (mc_width/2+7)+"px");
+ text_half_length = $(".itext_CC > .text").css("width").substr(0,$('.text').css("width").length-2)/2*(-1)+"px";
+ $(".itext_CC").css("margin-left", text_half_length);
+ } else {
+ $(".itext_CC").css("visibility", "hidden");
+ }
+ } else {
+ if (content[i]) {
+ $(".itext_"+i).html(content[i]);
+ $(".itext_"+i).css("visibility", "visible");
+ } else {
+ $(".itext_"+i).css("visibility", "hidden");
+ }
+ }
}
}
});
Modified: itext/styles/subtitles.css
===================================================================
--- itext/styles/subtitles.css 2009-07-21 07:07:58 UTC (rev 3967)
+++ itext/styles/subtitles.css 2009-07-21 07:08:06 UTC (rev 3968)
@@ -77,18 +77,43 @@
display: block;
}
-div.captioncontainer {
+div.itext_CC {
background-color: #333333;
opacity:0.8;
padding: 7px 7px 4px 7px;
visibility: hidden;
bottom: 0;
position: absolute;
+ z-index: 100;
}
-div.captioncontainer > div.text {
+div.itext_CC > div.text {
color: white;
opacity: 100%;
text-align: center;
}
+div.itext_TAD {
+ visibility: hidden;
+ float: left;
+ margin: 0;
+ padding: 0;
+ padding-right: 14px; /* make sure not to get visible behind the video */
+ width: 0
+ height: 0;
+ bottom: 0;
+ position: absolute;
+ z-index: -100;
+}
+
+div.itext_CUE {
+ visibility: hidden;
+ margin: 0;
+ padding: 0;
+ padding-right: 14px; /* make sure not to get visible behind the video */
+ width: 0
+ height: 0;
+ bottom: 0;
+ position: absolute;
+ z-index: -200;
+}
More information about the commits
mailing list