Showing posts with label youtube. Show all posts
Showing posts with label youtube. Show all posts

Saturday, September 25, 2010

Load A YouTube Video Inside A SWF File

Flash Video Flash Video

The YouTube API

the YouTube AS3 API doesn't require you to download and install a special component for you to be able to play YouTube videos inside your project, instead you directly load a special YouTube file during runtime using the Loader Class and then use that file to play any video you want.

The basic process outline for loading the API and using it is as following:

  1. Configure Domain Security to allow YouTube to communicate with the swf.
  2. Create a variable to hold a reference to the YouTube player (http://www.youtube.com/apiplayer?version=3).
  3. Use the Loader Class to load the YouTube API file
  4. Create event handlers to control the player once the API file has successfully loaded and got initiated.
  5. Play the YouTube video by the API ID (_OBlgSz8sSM",0).

Security.allowDomain("www.youtube.com");

var my_player:Object;

var my_loader:Loader = new Loader();
my_loader.load(new URLRequest("http://www.youtube.com/apiplayer?version=3"));
my_loader.contentLoaderInfo.addEventListener(Event.INIT, onLoaderInit);

function onLoaderInit(e:Event):void{
addChild(my_loader);
my_player = my_loader.content;
my_player.addEventListener("onReady", onPlayerReady);
}

function onPlayerReady(e:Event):void{
my_player.setSize(640,360);
my_player.cueVideoById("5KWHPg7g5WI",0);
}

play_btn.addEventListener(MouseEvent.CLICK, playVid);
function playVid(e:MouseEvent):void {
my_player.playVideo();
}
pause_btn.addEventListener(MouseEvent.CLICK, pauseVid);
function pauseVid(e:MouseEvent):void {
my_player.pauseVideo();
}

Finding the ID

The ID of the video is the string at the end of a YouTube URL that follows the v=.

5KWHPg7g5WI

youtube url

Player API Youtube API Overview Guide. The YouTube APIs and Tools let you bring the YouTube experience to your webpage, application, or device. The Data API lets you perform most of the operations a normal YouTube user can on the YouTube website. The Player APIs let you control the YouTube player using JavaScript or ActionScript. There is the basic embedded player you are used to seeing as well as the chromeless player that lets you create your own player controls.

Lastly there are the Widgets, and a custom player that you can embed on your webpage, even if you are not a web programmer.


YouTube video player with live preview playlist

youtube player

This player is for YouTube videos, it uses YouTube API batch processing to get video's information, which allows to fetch data for up 50 videos with a single API call.

Only $17 at Activeden

Thursday, September 23, 2010

Desktop Youtube AIR App

Adobe AIR Flash Video
youtube for air

Offer an exciting new way for customers and users to watch your videos with an innovative, branded desktop application. Companies like eBay, AOL and NASDAQ are already using Adobe AIR to deliver engaging RIAs to their users’ desktops.

5 minutes to get ready:
You’ll need just 5 minutes to customize the application for your site/videos and start distributing it to your audience. The package includes full documented guide and PSDs files with individual layers for each component.

Very easy customization! Even if you have no previous experience with Flex! Complete step by step guide inside.
If you think that you can’t use this file because you don’t have any Flex experience, relax. In the customizing process you’ll basically need to open the source, edit the youtube user or playlist and blog/site URL and give a name to your App. Just it! Really easy and in package you’ll find a complete guide to do that.

Why you will love it:
  • An innovative way to approach your user;
  • Run on all major desktop operating systems;
  • Full documented file, with step by step guide for importing, customize and export your App;
  • Complete PSD with entire Application layout;
  • Ready-to-customize individual layers for each component separately;
  • Easy to set and start using;
  • Minimize to the tray option;
  • Add unlimitted number of videos;
  • Fullscreen option for videos;
  • Play videos from your youtube user or from any playlist;
  • Unique. Anyone of your competitors have this.
XML Driven!
Update your information in a XML and all your user will get thw news. Update, add and remove your youtube videos and all your user will be updated too!

Activeden
Related Posts Plugin for WordPress, Blogger...