![]() This option returns an array of tracks, but the tracks in the array contain many more properties than the tracks in the cc module: Since the name of each track isn’t reliably exposed, you’ll need to provide your own function that converts language codes to readable language names. This can be used to create a popup menu listing all available subtitle tracks by language. The only useful and reliable information is the languageCode for each track. Each item is the same as an individual track, as defined two rows up in this table. In the captions module, the track option from my experience always returns an empty object Although the availability of an ASR-generated track doesn’t trigger the loading of the module on its own, it is included as one of the available tracks exposed via the API. kind – from my experience this is either null or “asr” (for automatic speech recognition). ![]() name – from my experience this is always an empty string (“”).languageCode – the ISO 639-1 language code of the current track.In the cc module, the track option returns an object with three properties: This option is described in the API reference. This option is described in the API reference, and presumably behaves the same for both modules, though I didn’t test it. Since the latter might be a possibility, you should exercise caution in using these options. I’m not sure whether that means the API Reference is out of date or the undocumented options are unofficial and might disappear without notice. The API Reference only documents two of these options (fontSize and reload). The table below lists the options that each of these modules supports. captions – captions module for the HTML5 player.cc – captions module for the AS3 player.If they’re getting the HTML5 player, the API uses the captions module, which is different not only in name, but in its available options. The API Reference says “Currently, the only module that you can set options for is the cc module, which handles closed captioning in the player.” This is only true if the user is getting the Action Script 3 (Flash) player. Next, here’s what you won’t find in the YouTube API documentation… YouTube HTML5 Video page, where users can switch to the HTML5 player (or switch back to Flash).YouTube Embedded Players and Player Parameters reference.Based on my reading of the YouTube API Reference I hadn’t thought it was possible to control captions from an external player, but it turns out the YouTube API has undocumented secrets, which I thought I’d document here to save other developers some headaches. Ideally, users would have the flexibility to toggle YouTube’s captions on and off and change the language of subtitles from any player, not just on the YouTube website. This is browser-specific, so it only tracks the user’s current caption preference within the current browser. Conversely, if they’ve turned captions off on YouTube, they won’t see captions in an embedded player, even if the video has captions available. If a user has turned captions on via the YouTube website, then they get captions in embedded YouTube players for any video that has captions (automated captions don’t count). It was already possible to use Able Player to play YouTube videos, but until now we had relied entirely on YouTube to handle captions on its own, which isn’t necessarily intuitive or convenient for users. ![]() I rolled out a new version of Able Player over the weekend, and the new version (2.2.1) now supports YouTube captions and subtitles.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |