I'm currently in the process of creating a plugin that allows a protocol other than the built-in OSMF protocols. On a high-level how should I go about doing this? I've created a CustomNCFactory that extends NetConnectionFactory and creates a new CustomNetConnection via NetConnectionFactory.createNetConnection().
Using a hypothetical protocol, let's call it APPLE, how would I go about checking for this protocol in the URL and then performing certain connection level operations based on the protocol?
Thanks in advance.
Assuming your custom protocol works with NetConnections, you would need to subclass NetLoader and override canHandleResource. This method would need to look at the URL that's passed in to look for the protocol, and return true if that protocol is present. The canHandleResource method is what the framework keys off of to decide whether to instantiate the MediaElement from a loaded plugin.
But if your custom protocol doesn't go through NetConnection, then there's no reason to work with NetLoader and NetConnectionFactory. Instead, you could just subclass LoaderBase directly.
Thanks for that extremely helpful direction. It looks like the NetLoader.executeLoad() method would need to be overridden as well? So that I can handle the custom protocol?