A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Autoplay embedded youtube video

  1. #1
    Member
    Join Date
    May 2007
    Location
    QLD, Australia
    Posts
    36

    Autoplay embedded youtube video

    I am embedding a youtube video in a scene, but when I load the youtube video it shows the big play button in the middle of the video instead of just playing. Can anyone please tell me the line of code to kick the thing into action automatically?

    Code:
    on (press) {
    	stopAllSounds();
    	
    	System.security.allowDomain("http://www.youtube.com"); 
    	System.security.loadPolicyFile("http://www.youtube.com/crossdomain.xml"); 
    	
    	var ldsceneholder = new MovieClipLoader();
    	ldsceneholder.loadClip("http://www.youtube.com/v/IMGYpOxvHDk.swf", mc100);
    	ldsceneholder.onLoadInit = function(mc) {
    		mc100._width = 50;
    		mc100._height = 50;
    	}
    }

  2. #2
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    I think you can add &autoplay=true to the URL

    See this page
    http://www.jakeludington.com/ask_jak..._playback.html

  3. #3

  4. #4
    Member
    Join Date
    May 2007
    Location
    QLD, Australia
    Posts
    36
    That didn't seem to work. It probably doesn't matter anyway, I have found that the koolmoves mediaplayer solves any issues there, providing you can resolve the flv address from youtube. I couldn't figure that out but ended up resorting to using a google cache address for the youtube video. A google search will give a correct way to resolve the flv location.

  5. #5
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    It didn't work with you're URL but When I pasted your YouTube URL into my browser, YouTube does some sort of redirect and if you take that URL and add the autoplay variable it does work.

    You're URL resolves as
    http://www.youtube.com/jp.swf?video_...b0ONt-BN-_kHw-

    Then I added &autoplay=true and viola
    http://www.youtube.com/jp.swf?video_...&autoplay=true

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center