1

After using MediaElement on our site for nearly a year with no problems, we've suddenly started seeing Chrome fall back to Flash for h.264 encoded .mp4 files that were playing natively for months. We could live with that, but at the same time playback has started displaying captions by default. If we select to show captions, we get two sets of them displaying simultaneously.

My first suspicion is that Google pushed out an update to Chrome that's affecting native h.264/.mp4 playback. I'm going to start looking into that, but if anyone knows it's from a different cause or has suggestions for a solution, I'd be very happy to hear them.

You can view the problem in this clip: http://kcts9.org/pie/forte#/clip/3

EDIT: In digging into the HTML, I'm realizing Flash was a red herring. The web developer apparently chose to write embed code into the element, but MediaElement isn't actually using it. Chrome appears to be opting to display the captions on it's own when the file is playing back natively. It is not using the MediaElement CSS to style the captions.

avaunt
  • 93
  • 1
  • 9
  • I've been search for information on this for days, and finally came across [this informative answer] by Offbeatmammal. I haven't had a chance to try it yet, but it looks promising. [this informative answer]:[http://stackoverflow.com/questions/14916914/toggling-closed-caption-in-html5-video-and-disabling-default-video-controls] – avaunt Jun 02 '13 at 14:52
  • Mangled my markdown - wish SO had a preview function. – avaunt Jun 02 '13 at 14:58

1 Answers1

1

Not fully tested in all browsers, but this JavaScript is solving my Chrome issue. (I have a suspicion that a newer version of MediaElement.js might address this, but we can't upgrade easily due to jQuery version dependencies.)

// Begin Caption Hiding Script
var vidz = document.getElementsByTagName('video');
for (var i = 0, j = vidz.length; i < j; i++) {
    vidz[i].textTracks[0].mode = "hidden";
};
// End Caption Hiding Script
avaunt
  • 93
  • 1
  • 9