cgiffard / Captionator

HTML5 polyfill for closed captioning with the <track> element, and implements the WHATWG Timed Text Track specification.
captionatorjs.com
300 stars 66 forks source link

Firefox 21 does not display the Captions #34

Closed codeuniquely closed 11 years ago

codeuniquely commented 11 years ago

The Subtitles show for Chrome but when using Firefox 21 and this simple HTML below. do not show in Firefox

<!DOCTYPE html>
<html lang="en-GB">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
    <video controls width="640" height="480" >
        <source src="video.mp4" type="video/mp4">
        <source src="video.webm" type="video/webm">
        <source src="video.ogv" type="video/ogg">    
        <track src="video.vtt" kind="captions" srclang="en" label="English" />
    </video>
<script type="text/javascript" src="captionator.js"></script>
<script type="text/javascript" >
window.addEventListener("load", function(e) 
{
    captionator.captionify();
});
</script>    
</body>
</html>
cgiffard commented 11 years ago

Sorry it's taken so long to get back to you - I've been bedridden with a terrible flu!

Chrome has native support for captions now, which is why the behaviour is different to Firefox, which doesn't yet.

Tracks are disabled by default (the Chrome devs may have decided to override this behaviour) and in order to get them to appear, you need to enable them using the JS API, or by adding the default parameter to the track tag:

<track src="video.vtt" kind="captions" srclang="en" label="English" default />