Skip to content
This repository has been archived by the owner on May 26, 2021. It is now read-only.

Commit

Permalink
Nobody uses Chrome 10 any more. Thank god.
Browse files Browse the repository at this point in the history
  • Loading branch information
cgiffard committed Nov 8, 2011
1 parent 3cf4b74 commit 08cbeec
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions js/captionator.js
Expand Up @@ -395,7 +395,7 @@
this.refreshCues();
};
captionator.ActiveTextTrackCueList.prototype = new captionator.TextTrackCueList(null);

/**
* @constructor
*/
Expand Down Expand Up @@ -538,7 +538,7 @@
this.onenter = function() {};
this.onexit = function() {};
};

// Captionator internal cue structure object
/**
* @constructor
Expand Down Expand Up @@ -616,15 +616,15 @@
};
};
captionator.CaptionatorCueStructure.prototype = [];

// if requested by options, export the object types
if (options.exportObjects) {
window.TextTrack = captionator.TextTrack;
window.TextTrackCueList = captionator.TextTrackCueList;
window.ActiveTextTrackCueList = captionator.ActiveTextTrackCueList;
window.TextTrackCue = captionator.TextTrackCue;
}

// Next time captionator.captionify() is called, the objects are already available to us.
objectsCreated = true;
}
Expand All @@ -646,12 +646,12 @@
videoElements.push(element);
}
}

if (videoElements.length) {
videoElements.forEach(function(videoElement) {
videoElement.addTextTrack = function(id,kind,label,language,src,type,isDefault) {
var allowedKinds = ["subtitles","captions","descriptions","captions","metadata","chapters"]; // WHATWG SPEC

var textKinds = allowedKinds.slice(0,7);
var newTrack;
id = typeof(id) === "string" ? id : "";
Expand Down Expand Up @@ -786,11 +786,11 @@
trackEnabled = true;
}
}

// If the text track kind is descriptions and the user has indicated an interest in having text descriptions
// with this text track language and text track label enabled, and there is no other text track in the media element's
// list of text tracks with a text track kind of descriptions whose text track mode is showing

if (trackObject.kind === "descriptions" && (options.enableDescriptionsByDefault === true) && (defaultLanguage === trackObject.language)) {
if (!trackList.filter(function(trackObject) {
if (trackObject.kind === "descriptions" && trackObject.mode === captionator.TextTrack.SHOWING) {
Expand All @@ -802,10 +802,10 @@
trackEnabled = true;
}
}

// If there is a text track in the media element's list of text tracks whose text track mode is showing by default,
// the user agent must furthermore change that text track's text track mode to hidden.

if (trackEnabled === true) {
trackList.forEach(function(trackObject) {
if(trackObject.trackNode.hasAttribute("default") && trackObject.mode === captionator.TextTrack.SHOWING) {
Expand Down Expand Up @@ -838,7 +838,7 @@
trackObject.mode = captionator.TextTrack.SHOWING;
}
});

videoElement.addEventListener("timeupdate", function(eventData){
var videoElement = eventData.target;
// update active cues
Expand Down Expand Up @@ -1112,7 +1112,7 @@
"textAlign": "center"
});
};

for (nodeIndex in DOMNode.childNodes) {
if (DOMNode.childNodes.hasOwnProperty(nodeIndex)) {
currentNode = DOMNode.childNodes[nodeIndex];
Expand Down Expand Up @@ -1631,12 +1631,6 @@
"lineHeight": baseLineHeight + "pt",
"boxSizing": "border-box"
});

// Defeat a horrid Chrome 10 video bug
// http://stackoverflow.com/questions/5289854/chrome-10-custom-video-interface-problem/5400438#5400438
if (window.navigator.userAgent.toLowerCase().indexOf("chrome/10") > -1) {
containerObject.style.backgroundColor = "rgba(0,0,0,0.01" + Math.random().toString().replace(".","") + ")";
}
},
/*
captionator.parseCaptions(string captionData, object options)
Expand Down

0 comments on commit 08cbeec

Please sign in to comment.