This is a discussion on Play Youtube videos into my Flash video player within the Flash Actionscript Programming forums, part of the Web Development category; Hi, I am trying to play the Youtube videos into my Flash player. I got video details from an xml ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| Hi, I am trying to play the Youtube videos into my Flash player. I got video details from an xml file provided by the Youtube Api. But i cant able to play the videos. Can anyone help me to finish my work successfully. Thanks in Advance.
__________________ The OXYGEN Delivers edgy, intelligent Technology to all... Last edited by oxygen : 03-11-2008 at 03:39 AM. |
|
#2
| |||
| |||
| Hi, You can get the video id from the xml file is it right. Then its simple to play. 1) First create a movieclip and place outside the stage area. And name it as "loadmc". 2)Then place a video object on to the stage. and name it as "videoPlayBack". 3) Attach these codes in the first Frame. Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.setBufferTime(5);
videoPlayBack.attachVideo(ns);
//http://www.youtube.com/watch?v=j_GADQv3vKs
var _mcl:MovieClipLoader = new MovieClipLoader ();
var _mcllistener:Object = new Object();
_mcl.addListener(_mcllistener);
_mcllistener.onLoadInit=function(target:MovieClip){
var _lv:LoadVars = new LoadVars ();
_lv.decode (target._url.split ("?")[1]);
var str:String = "http://www.youtube.com/get_video.php?";
str += "video_id=" + _lv.video_id;
str += "&t=" + _lv.t;
trace(_lv.t);
clearInterval(my_interval);
ns.close();
ns.play(str);
_mcl.unloadClip (target);
}
function getTrack_Id(id){
_mcl.loadClip("http://www.youtube.com/v/"+id,loadmc);
}
getTrack_Id("Z5hmHDXiwA4")
__________________ A.Ramesh Failure is not the End…it is your stepping stone to success! |
|
#3
| |||
| |||
| I having trouble getting this to work. Do you have a working sample? Thanks |
|
#4
| |||
| |||
| Quote:
Then I found this code which is much much simpler. Don't need to create any elements just past the actionscript in the first frame. You may need to test this on a server to see it really work. Code: var id = "4YBxeDN4tbk";
this.createEmptyMovieClip("video_mc", 10000);
this.video_mc.loadMovie("http://www.youtube.com/v/"+id); |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| to play video files in VB.NEt application | arjkhanna | VB.NET Programming | 3 | 10-02-2009 01:02 AM |
| Sharing: How to make a video sharing website like YouTube | Shirley1874 | HTML, CSS and Javascript Coding Techniques | 5 | 09-24-2009 07:34 PM |
| How to play the videos in PHP | Vani Sri | PHP Programming | 8 | 01-19-2009 05:55 PM |
| media player not playing videos in web design. | suman | Web Design Help | 1 | 08-19-2008 11:47 PM |
| How to Add Flash, Video, and Audio to Web Pages | killerkev06 | Web Design Help | 3 | 03-22-2007 03:46 AM |
Our Partners |