Permalink
Browse files

FLUID-4844: Adding some code that will either use the Captionator API…

… for 'mode' or the spec API. This is not the ideal way of fixing the issue, but it gets the captions back in Chrome.
  • Loading branch information...
1 parent 2afc880 commit 0a96c5f5e411f0726c076a52281099499c870421 @michelled committed Jan 3, 2013
Showing with 9 additions and 3 deletions.
  1. +9 −3 js/VideoPlayer_html5Captionator.js
@@ -63,15 +63,21 @@ https://source.fluidproject.org/svn/LICENSE.txt
fluid.videoPlayer.html5Captionator.hideAllTracks = function (tracks) {
fluid.each(tracks, function (trackEl) {
- trackEl.track.mode = trackEl.track.DISABLED;
+ // TODO: Here we are deciding whether to use the Captionator API or the spec API
+ // We should actually fix Captionator to use the spec API instead of doing this
+ trackEl.track.mode = trackEl.track.DISABLED === undefined ? "disabled" : trackEl.track.DISABLED;
});
};
fluid.videoPlayer.html5Captionator.showCurrentTrack = function (currentCaptions, tracks, captionSources) {
fluid.each(captionSources, function (element, key) {
- var currentState = $.inArray(key, currentCaptions) === -1 ? "DISABLED" : "SHOWING";
+ var currentState = $.inArray(key, currentCaptions) === -1 ? "disabled" : "showing";
var track = tracks[key].track;
- track.mode = track[currentState];
+ // TODO: Here we are deciding whether to use the Captionator API or the spec API
+ // We should actually fix Captionator to use the spec API instead of doing this
+ var captionatorModeVal = track[currentState.toUpperCase()];
+ // Need to test against undefined because Captionator uses numeric values for mode
+ track.mode = captionatorModeVal === undefined ? currentState : captionatorModeVal;
});
};

0 comments on commit 0a96c5f

Please sign in to comment.