hi www.youtubeloader.com
On Mar 3, 1:36 pm, koteshwar Rao myneni <[email protected]>
wrote:
> hi all ,
>
> I am stuck in getting youtube flv loacation .... i tried the below
> code but...i am not getting...
>
> //========================================
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
> creationComplete="onAppCreationComplete ()"
> horizontalAlign="left"
> width="800"
> height="644">
> <mx:Script>
> <![CDATA[
> import flash.net.*;
> import flash.events.*;
> import flash.display.*;
> private var loader:Loader;
> private var abortId:uint;
> private function onAppCreationComplete ():void
> {
> loader = new Loader ();
> }
> private function startLoading ():void
> {
> //var req:URLRequest = new URLRequest
> ("http://www.youtube.com/v/
> 3IcwG0jUFxU");
> //urlText
>
> var req:URLRequest = new URLRequest
> (urlText.text);
> Security.allowDomain(urlText.text);
>
>
> loader.contentLoaderInfo.addEventListener(Event.INIT,
> handlerLoaderInit);
> loader.load(req);
> logMessage ("Loading YouTube URL..");
> }
> private function handlerLoaderInit (event:Event):void
>
> {
> logMessage ("Loaded, processing: " +
> loader.contentLoaderInfo.url);
> var urlVars:URLVariables = new URLVariables
> ();
> urlVars.decode
> (loader.contentLoaderInfo.url.split("?")[1]);
>
> logMessage ("Processed:-");
> logMessage ("\t\t video_id:" +
> urlVars.video_id);
> logMessage ("\t\t t param:" + urlVars.t);
> logMessage ("\t\t thumbnail-url:" +
> urlVars.iurl);
> thumd.source = urlVars.iurl
> var flvURL:String = constructFLVURL
> (urlVars.video_id, urlVars.t);
> logMessage ("YouTube FLV URL: " + flvURL);
> playVideo (flvURL);
> logMessage ("Started Playing Video...");
> loader.unload();
> }
> private function constructFLVURL (video_id:String,
> t:String):String
> {
> //http://cache.googlevideo.com/get_video?
> video_id=M0ODskdEPnQ&origin=youtube.com
> //http://cache.googlevideo.com/get_video?
> //var str:String =
> "http://www.youtube.com/get_video.php?";
>
> var str:String =
> "http://www.youtube.com/get_video.php?";
> str += "video_id=" + video_id;
> str += "&t=" + t;
> return str;
> }
>
> private function playVideo (url:String):void
> {
>
> //player.source =
> "http://www.youtube.com/get_video.php?
> video_id=JrtxR-Ia0iA&t=R6ZRYUVjLwoZRQBNbIabkEolskKX_Sh4C"
> //Security.allowDomain(url);
>
> player.source = url;
> player.play();
> }
> private function logMessage (message:String):void
> {
> outputText.text += message + "\n";
> trace (message);
> }
> ]]>
> </mx:Script>
> <mx:HBox width="100%">
> <mx:Label text="YouTube Video URL:"/>
> <mx:TextInput id="urlText" width="300"/>
> <mx:Button label="Submit" click="startLoading ()"
> id="submitButton"/
>
> </mx:HBox>
> <mx:HBox width="100%">
> <mx:VBox height="100%">
> <mx:Label text="VideoDisplay:"/>
> <mx:VideoDisplay width="320" height="240" id="player"/>
> <mx:Button label="play" click="{player.play();}" />
> </mx:VBox>
> <mx:VBox height="100%" width="100%">
> <mx:Label text="Output:-"/>
> <mx:TextArea id="outputText" width="100%"
> height="100%"/>
> </mx:VBox>
> </mx:HBox>
> <mx:Image width="250" height="244" id="thumd"/>
> </mx:Application>
> //============================================
>
> any help... thanks in advance
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---