This is a new extension I have been working on for a little while now (Over 2,000 lines of code :crazy: ). It allows you to embed/display YouTube videos in your swf files. You can have up to six videos running in your app at one time.(There is a reason for this which I will explain later.) There are two different ways to display movies:
- Embedded Player
- Chromeless Player
The Embedded Player is very limited, and shows the default controls you see on YouTube. You can control this player like you would on the website. You cannot change the size of the player, as it depends on the resolution of the video embedded, and auto scales to the closest size: Default is 480px by 385px.
The Chromeless Player is something I have been working on that allows much more control. This only shows the YouTube logo in the corner of the video, without any of the default controls. You can move, size, and completely control the video through events, even at runtime, which I show in one of the examples located below. This allows you to have full control over your interface, and what your videos do. I added expressions that allow you to get the state of the video(playing, buffering, ended, etc.), bytes loaded, video size, and even the bytes loaded since the video position has changed.
Loading videos is straightforward. You load them by their 11 digit id which is uaually after a ?v=. If a YouTube Url is: http://www.youtube.com/watch?v=WE-sHASGToE then the id would be: WE-sHASGToE.
The extension comes with two examples. The .html, .swf, and .mfa files are all included. You can preview them online at the following links:
- Example 1 (6 random YouTube videos all playing at once)
- Example 2 (A random YouTube video moving around the screen being controlled by events)
Let me know what you guys think. I love hearing feedback, so have fun testing this extension, and feel free to show off what you create.