Skip to content

Commit

Permalink
Merge remote-tracking branch 'ScottDowne/t609' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jbuck committed Jun 24, 2011
2 parents 13e585d + 40f73dc commit ce9fb20
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 19 deletions.
1 change: 0 additions & 1 deletion parsers/parserSBV/popcorn.parserSBV.unit.html
Expand Up @@ -26,7 +26,6 @@ <h2 id="qunit-userAgent"></h2>
<video id='video'
controls
width= '250px'
data-timeline-sources="data/data.sbv"
poster="../../test/poster.png">

<source id='mp4'
Expand Down
2 changes: 1 addition & 1 deletion parsers/parserSBV/popcorn.parserSBV.unit.js
Expand Up @@ -29,7 +29,7 @@ test( "Popcorn 0.3 SBV Parser Plugin", function () {
}
}

poppercorn.parseSBV( document.getElementById( "video" ).getAttribute( "data-timeline-sources" ) );
poppercorn.parseSBV( "data/data.sbv" );

expect(expects);

Expand Down
3 changes: 1 addition & 2 deletions parsers/parserSRT/popcorn.parserSRT.unit.html
Expand Up @@ -26,7 +26,6 @@ <h2 id="qunit-userAgent"></h2>
<video id='video'
controls
width="250px"
data-timeline-sources="./data/unit.srt"
poster="../../test/poster.png">

<source id='mp4'
Expand All @@ -41,4 +40,4 @@ <h2 id="qunit-userAgent"></h2>

</video>
</body>
</html>
</html>
4 changes: 2 additions & 2 deletions parsers/parserSRT/popcorn.parserSRT.unit.js
Expand Up @@ -74,7 +74,7 @@ test("Popcorn 0.3 SRT Parser Plugin", function () {
}
}

poppercorn.parseSRT( document.getElementById( 'video' ).getAttribute( 'data-timeline-sources' ) );
poppercorn.parseSRT( "data/unit.srt" );

expects = expectedSubs.length*4+1;
expect( expects );
Expand Down Expand Up @@ -105,4 +105,4 @@ test("Popcorn 0.3 SRT Parser Plugin", function () {

}, 500);

});
});
1 change: 0 additions & 1 deletion parsers/parserSSA/popcorn.parserSSA.unit.html
Expand Up @@ -26,7 +26,6 @@ <h2 id="qunit-userAgent"></h2>
<video id='video'
controls
width= '250px'
data-timeline-sources="data/data.ssa"
poster="../../test/poster.png">

<source id='mp4'
Expand Down
2 changes: 1 addition & 1 deletion parsers/parserSSA/popcorn.parserSSA.unit.js
Expand Up @@ -29,7 +29,7 @@ test( "Popcorn 0.3 SSA/ASS Parser Plugin", function () {
}
}

poppercorn.parseSSA( document.getElementById( "video" ).getAttribute( "data-timeline-sources" ) );
poppercorn.parseSSA( "data/data.ssa" );

expect( expects );
stop( 5000 );
Expand Down
1 change: 0 additions & 1 deletion parsers/parserTTML/popcorn.parserTTML.unit.html
Expand Up @@ -26,7 +26,6 @@ <h2 id="qunit-userAgent"></h2>
<video id='video'
controls
width= '250px'
data-timeline-sources="data/unit.ttml"
poster="../../test/poster.png">

<source id='mp4'
Expand Down
2 changes: 1 addition & 1 deletion parsers/parserTTML/popcorn.parserTTML.unit.js
Expand Up @@ -73,7 +73,7 @@ test( "Popcorn 0.3 TTML Parser Plugin", function () {
}
}

poppercorn.parseTTML( document.getElementById( 'video' ).getAttribute( "data-timeline-sources" ) );
poppercorn.parseTTML( "data/unit.ttml" );

expect( expects );
stop( 5000 );
Expand Down
1 change: 0 additions & 1 deletion parsers/parserTTXT/popcorn.parserTTXT.unit.html
Expand Up @@ -26,7 +26,6 @@ <h2 id="qunit-userAgent"></h2>
<video id='video'
controls
width= '250px'
data-timeline-sources="data/unit.TTXT"
poster="../../test/poster.png">

<source id='mp4'
Expand Down
2 changes: 1 addition & 1 deletion parsers/parserTTXT/popcorn.parserTTXT.unit.js
Expand Up @@ -29,7 +29,7 @@ test("Popcorn 0.3 TTXT Parser Plugin", function () {
}
}

poppercorn.parseTTXT(document.getElementById('video').getAttribute('data-timeline-sources'));
poppercorn.parseTTXT( "data/unit.TTXT" );

expects = subs.length*3+1;
expect(expects);
Expand Down
3 changes: 1 addition & 2 deletions parsers/parserVTT/popcorn.parserVTT.unit.html
Expand Up @@ -26,7 +26,6 @@ <h2 id="qunit-userAgent"></h2>
<video id='video'
controls
width= '250px'
data-timeline-sources="data/unit.vtt"
poster="../../test/poster.png">

<source id='mp4'
Expand All @@ -41,4 +40,4 @@ <h2 id="qunit-userAgent"></h2>

</video>
</body>
</html>
</html>
4 changes: 2 additions & 2 deletions parsers/parserVTT/popcorn.parserVTT.unit.js
Expand Up @@ -38,7 +38,7 @@ test( "Popcorn 0.3 WebSRT/VTT Parser Plugin", function () {
}
}

poppercorn.parseVTT( document.getElementById( 'video' ).getAttribute( 'data-timeline-sources' ) );
poppercorn.parseVTT( "data/unit.vtt" );
expect( expects );
stop( 5000 );

Expand All @@ -64,4 +64,4 @@ test( "Popcorn 0.3 WebSRT/VTT Parser Plugin", function () {

}, 500);

});
});
13 changes: 12 additions & 1 deletion plugins/subtitle/popcorn.subtitle.js
Expand Up @@ -217,7 +217,18 @@
options.accessibility = accessibility;

options.toggleSubtitles = function() {
options.selectedLanguage = options.languageSrc.options[ options.languageSrc.selectedIndex ].value;

options.selectedLanguage = options.languageSrc.options[ options.languageSrc.selectedIndex ].value;

if ( options.accessibility.checked || options.selectedLanguage !== ( options.language || "") ) {

options.display = "inline";
options.container.style.display = options.display;
} else if ( options.selectedLanguage === ( options.language || "") ) {

options.display = "none";
options.container.style.display = options.display;
}
};

options.accessibility.addEventListener( "change", options.toggleSubtitles, false );
Expand Down
23 changes: 21 additions & 2 deletions plugins/subtitle/popcorn.subtitle.unit.js
@@ -1,7 +1,7 @@
test("Popcorn Subtitle Plugin", function () {

var popped = Popcorn( "#video" ),
expects = 11,
expects = 14,
count = 0,
subTop = 9001,
subLeft = 9001,
Expand Down Expand Up @@ -73,6 +73,7 @@ test("Popcorn Subtitle Plugin", function () {
popped.exec( 1.5, function() {

popped.media.pause();

// check position of subttile that should of moved with video,
// a subtitle must be displayed to get valid data
ok( subtitlediv.style.left !== subLeft, "subtitle's left position has changed" );
Expand All @@ -91,6 +92,7 @@ test("Popcorn Subtitle Plugin", function () {

equals (subtitlediv.children[ 1 ].innerHTML, "this is the second subtitle of 2011", "subtitle displaying correct information" );
plus();

popped.media.play();

});
Expand All @@ -100,13 +102,30 @@ test("Popcorn Subtitle Plugin", function () {
popped.media.pause();
equals (subtitlediv.children[ 1 ].innerHTML, "", "subtitle is clear" );
plus();

popped.media.play();

});

popped.exec( 3.5, function() {

popped.media.play();

equals (subtitlediv.style.display, "inline", "subtitles being displayed with accessiblity on" );
plus();

// turn accessibility off
document.getElementById( "accessibility" ).click();

equals (subtitlediv.style.display, "none", "subtitles not being displayed with accessiblity off" );
plus();

// turn accessibility back on
document.getElementById( "accessibility" ).click();

equals (subtitlediv.style.display, "inline", "subtitles being displayed with accessiblity back on" );
plus();

equals (subtitlediv.children[ 2 ].innerHTML, "this is the third subtitle of 2011", "subtitle displaying correct information" );
plus();
popped.media.play();
Expand Down

0 comments on commit ce9fb20

Please sign in to comment.