I'm working on an application that needs to load flvs as well as YouTube videos. I'm actually using OSMF and I'm trying to avoid having to duplicate functions by creating a YouTube component and a FLV component.
How would you go about it? Ideally, I'd like to end up with a YouTube class that extends MediaElement.
You can check the source code of the YouTube OSMF plugin developed by the Flash/Strobe Media Playback team: http://sourceforge.net/adobe/smp/wiki/YouTube%20Plugin/
The plugin creates a YouTubeElement class which extends MediaElement, which uses the YouTube API.