Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fluid 4844 #103

Closed
wants to merge 2 commits into from

1 participant

Michelle
Michelle
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
Michelle 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
Michelle michelled FLUID-4844: Added the JIRA number to the TODO comments about fixing C…
…aptionator's mode API.
b324d32
Michelle 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. Michelle

    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. Michelle
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
12 js/VideoPlayer_html5Captionator.js
View
@@ -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.