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 |
| |||
| 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. |
| Sponsored Links |
| |||
| 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! |
![]() |
| Thread Tools | |
| Display Modes | |
| |
LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/flash-actionscript-programming/5414-play-youtube-videos-into-my-flash-video-player.html | |||
| Posted By | For | Type | Date |
| DiscussWeb IT Community - Technical Support and Technology Discussions | This thread | Refback | 03-16-2008 07:20 PM |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to create Real 3D videos that can be viewed with 3D Goggles on TV? | itbarota | Game Development | 1 | 07-19-2007 12:02 AM |
| How to create Real 3D videos that can be viewed with 3D Goggles on TV? | itbarota | Game Development | 0 | 07-17-2007 10:53 PM |
| Google and Youtube | nhoj | 6 | 04-26-2007 11:41 AM | |
| How to Add Flash, Video, and Audio to Web Pages | killerkev06 | Web Design Help | 3 | 03-22-2007 03:46 AM |
| YouTube marketing | deerhunter | Promotion Techniques | 0 | 02-25-2007 02:28 AM |