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

Subtitles disappear on full-screen mode in Firefox #27

Closed fletchgqc closed 12 years ago

fletchgqc commented 12 years ago

I noticed that in the demo. Is that related to Captionator?

fletchgqc commented 12 years ago

I noticed the same problem on the demo of Stories In Flight: http://www.storiesinflight.com/js_videosub/ and I've also seen this problem in MediaElement.js (though they talked about integrating captionator, perhaps they're now using your code anyway). So it seems to be a common problem on FireFox. But anyway, since captionator is the magic solution to all cross-browser problems, we shall have to solve it.

cgiffard commented 12 years ago

This is a broader issue, and not really a bug with Captionator, per se. Captionator isn't a video player, so it doesn't implement its own fullscreen functionality. However, this is precisely what it would have to do in order to draw subtitles in fullscreen mode.

I've written players which can support fullscreen subtitles using Captionator - it's a feature entirely at the developer's discretion.

First of all, you need to override the functionality of the browser's native fullscreen control. You can do this by switching the 'controls' attribute off, and drawing your own controls on top. Then, put your video in a container (some kind of unsemantic division element would do the trick.) Tell Captionator to draw subs into this container with the runtime option appendCueCanvasTo.

Then, make your own fullscreen button using the FullScreen API - which tells the container to go fullscreen. Then, your captions will be visible in fullscreen view! :)

Let me know if you have any trouble getting this to work (I can go into more detail if you'd prefer.)

fletchgqc commented 12 years ago

Well in the end it was easier to go with a player that had it implemented already. But thanks a lot anyway.