Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into FLUID-4837
Browse files Browse the repository at this point in the history
  • Loading branch information
acheetham committed Nov 9, 2012
2 parents e3ae830 + 7b26174 commit f73cf18
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 3 deletions.
1 change: 1 addition & 0 deletions js/MenuButton.js
Expand Up @@ -210,6 +210,7 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
fluid.videoPlayer.languageMenu.setUpKeyboardA11y(that);

that.container.attr("role", "menu");
that.container.css("z-index", 9999);
that.hideMenu();
that.updateTracks();
that.updateShowHide();
Expand Down
1 change: 0 additions & 1 deletion js/VideoPlayer.js
Expand Up @@ -617,7 +617,6 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt

// Set height on the controller area. To make overlay to show up exactly at the bottom of the video regardless to UIO settings
videoPlayer.css({height: videoHeight});
videoPlayer.css({width: videoWidth}); // Ensures the video and overlay will always be the same width (for ex., coming out of full-screen)

// Set the width of the overlay to be the width of the video, otherwise, the controller bar spreads into transcript area
overlay.css({width: videoWidth});
Expand Down
2 changes: 1 addition & 1 deletion js/VideoPlayer_transcript.js
Expand Up @@ -171,7 +171,7 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
var inTimeMillis;
if (track.text) {
// this is a Universal Subtitles format file
inTimeMillis = that.convertSecsToMilli(track.start_time);
inTimeMillis = track.start_time;
} else {
// a WebVTT compatible json format file
inTimeMillis = that.convertToMilli(track.inTime);
Expand Down
3 changes: 2 additions & 1 deletion tests/js/TestUtils.js
Expand Up @@ -78,7 +78,8 @@ fluid.registerNamespace("fluid.testUtils");

fluid.testUtils.initEnhancedVideoPlayer = function (instance, relay) {
var opts = fluid.copy(baseOpts);
$.extend(true, instance.options, opts);
$.extend(true, opts, instance.options);
instance.options = opts;
return fluid.videoPlayer.makeEnhancedInstances(instance, relay);
};

Expand Down
40 changes: 40 additions & 0 deletions tests/js/VideoPlayerTranscriptIntegrationTests.js
Expand Up @@ -62,5 +62,45 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
fluid.testUtils.initEnhancedVideoPlayer(instance, uiOptions.relay);
});

videoPlayerTranscriptIntegrationTests.asyncTest("Scrubbing", function () {
var vp;
var newTime = 0;
var instance = {
container: ".videoPlayer-transcript",
options: {
video: {
transcripts: [{
src: "http://www.youtube.com/watch?v=_VxQEPw1x9E&language=en",
type: "text/amarajson"
}]
},
templates: {
videoPlayer: {
href: "../../html/videoPlayer_template.html"
}
},
listeners: {
onReady: function (that) {
vp = that;
},
onTranscriptsLoaded: function (intervalList, transcriptTextId, that) {
var anElement = $($("[id^=flc-videoPlayer-transcript-element]")[7]);
newTime = (that.options.transcripts[0].tracks[7].start_time + 1) / 1000;
anElement.click();
},
onTimeChange: {
listener: function (currTime, buffered) {
jqUnit.assertEquals("New time is same as clicked transcript", newTime, currTime);
vp.events.onTimeChange.removeListener("timeChecker");
start();
},
namespace: "timeChecker"
}
}
}
};
fluid.testUtils.initEnhancedVideoPlayer(instance, uiOptions.relay);
});

});
})(jQuery);

0 comments on commit f73cf18

Please sign in to comment.