Skip to content

Commit

Permalink
[PBW-4455] fix for closed captions
Browse files Browse the repository at this point in the history
  • Loading branch information
rchalooyala committed Feb 20, 2016
1 parent 9f06e0e commit 9125eb1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/js/main_html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,9 @@ require("../../../html5-common/js/utils/environment.js");
// The textTrack added by QuickTime will not be removed by removing track element
// But the textTrack that we added by adding track element will be removed by removing track element.
// This first check is to check for live CC
if (OO.isSafari && _video.textTracks.length !== 0) {
if (OO.isSafari && _video.textTracks.length !== 0 && language == "CC") {
for (var i = 0; i < _video.textTracks.length; i++) {
if (_video.textTracks[i].language === language ||
(language == "CC" && _video.textTracks[i].kind === "captions")) {
if (_video.textTracks[i].kind === "captions") {
var mode = (!!params && params.mode) || 'showing';
_video.textTracks[i].mode = mode;
} else {
Expand All @@ -485,7 +484,7 @@ require("../../../html5-common/js/utils/environment.js");
}
} else {
var captionsFormat = "closed_captions_vtt";
if (closedCaptions[captionsFormat] && closedCaptions[captionsFormat][language]) {
if (closedCaptions && closedCaptions[captionsFormat] && closedCaptions[captionsFormat][language]) {
var captions = closedCaptions[captionsFormat][language];
var label = captions.name;
var src = captions.url;
Expand Down

0 comments on commit 9125eb1

Please sign in to comment.