Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fluid 4844 #103

Closed
wants to merge 2 commits into from

1 participant

@michelled
Owner

@jobara this pull request gets the captions back in Chrome. I've opened another JIRA to deal with Captionator not using the spec API for mode FLUID-4877

michelled added some commits
@michelled michelled 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.
0a96c5f
@michelled michelled FLUID-4844: Added the JIRA number to the TODO comments about fixing C…
…aptionator's mode API.
b324d32
@michelled michelled closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 3, 2013
  1. @michelled

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

    michelled authored
    … for 'mode' or the spec API. This is not the ideal way of fixing the issue, but it gets the captions back in Chrome.
  2. @michelled
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 3 deletions.
  1. +9 −3 js/VideoPlayer_html5Captionator.js
View
12 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: FLUID-4877 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: FLUID-4877 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;
});
};
Something went wrong with that request. Please try again.