IT Community - Software Programming, Web Development and Technical Support

Play Youtube videos into my Flash video player

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 ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Flash Actionscript Programming

Register FAQ Members List Calendar Mark Forums Read
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 03-11-2008, 03:36 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Default Play Youtube videos into my Flash video player

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.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-15-2008, 02:13 AM
aramesh aramesh is offline
D-Web Programmer
 
Join Date: Mar 2007
Posts: 71
aramesh is on a distinguished road
Default Re: Play Youtube videos into my Flash video player

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")
4) In this "Z5hmHDXiwA4" is the video id.
__________________
A.Ramesh
Failure is not the End…it is your stepping stone to success!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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 Google 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


All times are GMT -7. The time now is 02:22 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0