Reputation: 23
I'm setting up a simple little OSMF-based media player, and I have hooked up the org.osmf.captioning plugin found in the samples. It is working just groovy with video, but I also have audio files to play with captions, and it doesn't seem to do anything for those.
On initial inspection, I can't see anything in the plugin that ties it to a specific type of media. Nor can I find any indication that the timeline metadata used for captioning is only relevant to certain types of media.
Does the captioning plugin support audio playback? Might I have set it up incorrectly?
Upvotes: 0
Views: 235
Reputation: 23
I have since found that the Captioning plugin uses the org.osmf.net.NetLoader's 'canHandleResource' method to identify compatible media. This means that only video types will be supported. This seems like something of an oversight considering the very flexible nature of OSMF. It seems like anything with a time trait should be supported. In any case, I simply replaced that method with a more lenient one, and hey presto, it works. The offending code is in CaptioningPluginInfo where the MediaFactoryItem is defined.
var loader:NetLoader = new NetLoader();
var item:MediaFactoryItem = new MediaFactoryItem("org.osmf.captioning.CaptioningPluginInfo",
loader.canHandleResource,
createCaptioningProxyElement,
MediaFactoryItemType.PROXY);
Upvotes: 0