Display A YouTube Embedded Video In Flash Application?

Jan 24, 2010

The following is the code I am using to display a YouTube embedded video in my flash application.

Code:

Security.allowDomain("youtube.com");
var plr:MovieClip = new MovieClip();
addChild(plr);

[Code]....

I cannot load more than one of those in my app. As soon as I load one youtube vid like that, any others will fail to load UNLESS it was the same video as the first one loaded, in which case there seems to be a 50% chance that it will load. And even when the second one (the same as the first) does load, there are issues with the player loaded.... it seems they are connected somehow and get confused with each other. The trackbar will flicker between the play time of the first one and the play time of the second one.

Next problem... I cannot unload the video right away. Say my user wants to close the video out, when I use:

Code:

ldr.unload()

the player does NOT close its streams and you can hear the audio still playing (assuming it was closed before it was finished playing)...

In my eyes, this is horribly bad programming on YouTube's part. They claim that you are allowed to embed their videos in AS3.0, but if that's true then why does it have such a horrible time as a child SWF? Proper children SWF files should be listening for an "unload" call and close out anything they need to when unloaded.

Here is what I've tried so far:

- Seperating the videos by loading them into other children SWF files (children that I created that I've told to load a specific YouTube vid)

- loading at different times

- Allowing security access from YouTube

How can I load more than one YouTube video into my Flash App without causing problems between them? I'm at my wit's end.

View 2 Replies


Similar Posts:


ActionScript 2.0 :: Embedded YouTube Video In Flash - Black Bars On Playback

Mar 21, 2011

I have successfully embedded the youtube video in my flash code with:
//create area to put youtube video on screen
this.createEmptyMovieClip("reason1_video", 10000);
reason1_video._xscale = 60;
reason1_video._yscale = 60;
this.reason1_video.loadMovie("[URL]");

However, the video plays with black bars on top and bottom even though it plays without those directly from youtube: [URL]. Even if I take off the scaling, it still has the black bars. How do I get rid of them? It seems like youtube uses a different player than flash. [URL]. Click on #1 and you will see the video I am talking about.

View 1 Replies

Flash :: Youtube Embedded Video Activating Too Late To Accept Javascript Call

Oct 27, 2010

I have a YouTube video embedded in my page. It is hidden (display:none). You need to click one of the video link buttons to display the video and play it. The links are defined like this:

<a href="javascript:play('xxxxxxxxxxx')">Video 1</a>
<a href="javascript:play('xxxxxxxxxxx')">Video 2</a>
xxxxxxxxx represent YouTube video IDs.

[Code]....

It's fundamentally pretty simple! But here's the problem. since the video player is hidden, the flash object is not activated. So when I click a video link, the line ytplayer.style.display = 'block'; displays the video player, but it takes about about half a second for flash to load. During this time it cannot accept any method calls, such as the next line ytplayer.loadVideoById( id, 0, 'hd1080' );. Essentially, I have to click the link twice, once to load up the flash video player, the second time to actually load the video into the player.

View 1 Replies

HTML :: Avoid Scroll-Wheel Hijack By Embedded YouTube / Flash Video

Oct 27, 2011

I am making some improvements on a web-site that has a youtube video embedded in its home-page. I have not added this code myself, but it looks like:

<object width="380" height="307">
<param name="movie" value="[URL]" />
</param><param name="allowFullScreen" value="true" />
</param><param name="allowscriptaccess" value="always" />
</param><embed src="[URL]" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="380" height="307"></embed></object>

I have a small ux problem with this embedded object: When scrolling the page up or down using the scroll-wheel of the mouse, it stops working when the mouse cursor is hovering over the video. Are there any html / css / param settings that I can modify to avoid this? See the site itself for a working example. I experience the problem both in Windows 7 64bit and Ubuntu 11.10 64bit so far.

View 1 Replies

Jquery :: Embedded YouTube Video Not Working With Overflow:hidden

Jun 15, 2011

I'm having issues with a YouTube video breaking a jQuery slider when viewed on an Apple mobile device. The slider uses a set width & height window that uses the overflow:hidden property. It looks great in all browsers except for Apple devices where all of the slides are visible in a row as if the overflow:hidden property did not take effect.

Link to site: [URL]

Embedded video code:

[Code]....

View 1 Replies

JQuery :: Featured Content Slider - Embedded YouTube Video Overflow DIV

Feb 19, 2010

I created an ajax jQuery featured content slider that will automatically navigate through each tab. Each tab has some basic html. The one I used is this one: [URL]. For some reason, when I embed a flash video in it, the flash video overflows the div. It looks fine in Chrome and Safari but not the latest version of Firefox (3.6) on the PC. Is it not handling overflow or z-indexes correctly?

View 1 Replies

ActionScript 3.0 :: Stop Embedded Youtube Video From Displaying 'Just Watched' End Screen?

May 14, 2011

My site was 95% point and clicked and the rest getting lucky with mostly the right AS3 after searching the various forums etc. Please be patient and type slowly that I may understand

I managed to get a youtube embedded into my AS3 Flash site. Plays well enough and in the right box. Gota figure out how to default to 480 or 720 but thats not the problem... see below.

My questions is this: is there any way to stop the video from playing all the way through to Youtubes default end screen where it has the Just Watched and Up Next screen? Either by going back to the thumbnail it uses by default or by sending it to another page on my flash site?

The last thing I want is my viewer wandering away from my site ><.

Below is the code I used on the Video holder object Sorry i forgot the tute i pasted from - but it worked thank you who ever you may be:

Security.allowDomain("www.youtube.com");

// This will hold the API player instance once it is initialized.
var player:Object;
var loader:Loader = new Loader();

[Code].....

View 4 Replies

Flex :: Play Youtube Video From Application?

Jan 24, 2012

what the best way to embed a youtube player inside a flex app is. I've looked around and it seems that one can

Try to use SWFLoader (as with what's described here) but this ends up throwing crossdomain violations Use the YouTuve API Ideally use the Spark VideoPlayer component, although I have not been able to figure out how to play a YouTube video through it and am starting to think that it is, in fact, not possible.

View 2 Replies

Flash :: Display Video In A Flex Application?

Aug 16, 2011

I need to display Facebook video player in my Flex application. I retrieve URL via FB Graph API to a video being displayed in facebook video player and I pass it to SWFLoader. Unfortunately I have some problems with getting it displayed correctly.Facebook video player is displayed on Facebook site as 720x244 movie. The movie is displayed in the middle of it (320x240) and on the left and the right side there is black background.Is there any way to display central part (movie) only with SWFLoader? Here is my code:

<mx:Box width="320" height="240" verticalAlign="middle" horizontalAlign="center">
<mx:SWFLoader source="{'http://www.facebook.com/v/' + numberOfVideo}"
visible="true" id="video" autoLoad="true" />
</mx:Box>

View 1 Replies

Android :: Flex - Embed YouTube Video Player Into Mobile Application?

Apr 20, 2011

Is there any way to embed YouTube video/video player into Android Flex AIR Mobile application?

I tried to use SWFLoader(...) but since its MX library class only works on the desktop runtime environment, but fails to work on actual Android device when debugging the application.

Maybe it's possible to embed HTML that contain YouTube video into some Flex media container like TextArea or something?

View 1 Replies

ActionScript 2.0 :: Youtube Player Embedded In Flash?

Feb 5, 2009

I have embed the youtube flash player via this code.

Code:
// create a MovieClip to load the player into
var ytplayer:MovieClip = _root.createEmptyMovieClip("ytplayer", 1);
// create a listener object for the MovieClipLoader to use
var ytPlayerLoaderListener:Object = {

[code]....

I would Like to know, How can I run the destory command because the video keeps playing even though the command has been passed. I've used stopVideo and destory. they dont work until you press the pause button. I would like to end the video even if its playing.

View 4 Replies

Html :: For Embedded YouTube Clips If The User Doesn't Have Flash?

Jul 14, 2010

I'm embedding youtube clips on my site with the following code:

<object width="259" height="215" style="margin:auto; width:262px; height:217px; position:relative;">
<param name="movie" value="http://www.youtube.com/v/<?php echo $yt_id; ?

[code].....

View 2 Replies

Flash Video Player That Enables User To Embed Video Like YouTube Functionality

Jul 7, 2009

Just wondering where I could get a flash video player that enables the user to embed the video like youTube functionality.URL....

View 3 Replies

Javascript :: Gain Access To An Embedded Flash Video's Parameters That Is Embedded On A Site You Don't Own Via A Browser Extension?

Jan 2, 2011

I'd like to gain read only access to the following parameters of embedded Flash videos located on sites that I do not own through my own custom browser extension/add-on:

Time location of playback head (so I can display the current time in the browser extension via HTML5/JavaScript) Frames (so I can make capture them to an image file, save it and display image in browser extension) Original Dimensions in pixels (so I can display the original video dimensions via JS/HTML5 in browser extension)

Is this possible by using Javascript and HTML5 from a browser extension?

Would I have to use something like the SWFObject Javascript API [URL]

View 1 Replies

ActionScript 3.0 :: Video Control Menu For Youtube Video In Flash

Nov 22, 2010

by following a tutorial on [URL], I was able to display a youtube video in flash, but the problem is that the video doesn't have a control menu. Just wondering if there is a way to make one, either it is customized or some default menu provided by youtube or flash.

View 0 Replies

ActionScript 3.0 :: Youtube And Flash - User To Be Able To Click On A Video Thumbnail And That Video Plays Back In The Center Of The Document

Jan 12, 2009

In my CS4 flash document I have created a media gallery. It's a very simple interface that has mouse overs on thumbnail pictures, and then the larger picture will fadeUP in the center of the document. (With use of framelabels in the timeline).

In the same document, I want the user to be able to click on a video thumbnail, and that video plays back in the center of the document. Several questions: If the user clicks on the thumbnail "onrelease," the time line goes to the player, is it possible to stream this video from a youtube clip into my media player on the screen? If not and I have the document in a fl4 format, is there a simple process to have this video open? (I currently do not have the document in fl4 format).

View 0 Replies

ActionScript 3.0 :: Display The Html Embedded In The Xml And Display In The Flash

Oct 23, 2009

i have attached the fla and xml file. i need to display the html embeded in the xml and display in the flash.

View 0 Replies

XML :: YouTube Video In Flash AS3

Sep 3, 2011

I was making a player which calls videos from youtube and displays it in my flash playback component. The script loads the videos fine but when i want the flash to load the same video ID from an external XML data source, it loads the youtube player API but not the video. Here is the code

Security.allowDomain("www.youtube.com");
Security.allowDomain("*");
var my_player:Object;
var my_loader:Loader = new Loader();
my_loader.load(new URLRequest("[URL]"));
[Code] .....

This script loads the video from youtube.com with an specific ID which i have defined at
my_player.cueVideoById("53OyPYa7SEI",0)
Later I defined and XML file called "videos.xml" where I passed the youtube link and tried to call the video from that xml file in flash. But the problem comes there. Here is the xml code
<?xml version="1.0" encoding="ISO-8859-1" ?>
<videos>
<VIDEO url="[URL]" id=1/>
<VIDEO url="[URL]" id=2/>
</videos>
How to call the video from an XML file?

View 1 Replies

Java :: Youtube Keep Flash Video Playing / When Go To Users Profile Page From Video Page?

Aug 31, 2011

In the cosmicpanda update for youtube, you can go from a video page to the video creators profile page while your video is still playing in flash. Does anyone how Youtube accomplishes this? I would like to know if it's possible to keep the flash state of a site constant while moving from page to page on a site.It doesn't seem as if the flash is reloading, so I don't think that they are just saving cookies for the current video time and starting the video at that point when they refresh.I would assume that they're using ajax, but the application of this feature is really clean. The URL gets correctly changed to the users' profile page's URL. The back button still works as it should. (I can press back and forward between video page and user profile page and the video continues going clean and never drops.)

View 2 Replies

Add A Youtube Video To A Flash Page ?

Aug 5, 2010

For a website which is completely in flash. How do i embedd a youtube based video in order to save bandwidth ?

View 4 Replies

Professional :: How To Add Youtube Video To Flash

Mar 19, 2010

I am still new to AS. Looking for a detailed tutorial/explanation on adding/embeding a youtube video to flash. If anybody has a descent example that would work too. Also i would like the youtube video to play in the flash file.

View 1 Replies

Insert Youtube Video In Flash?

Nov 5, 2010

I am trying to put a youtube video in a flash file,this is my code,

system.Security.allowDomain("http://www.youtube.com")
movieMC.loadMovie("http://www.youtube.com/v/ghITcSYgEJ4S" );
closeBTN.onPress = function(){
unloadMovie("movieMC");
}

I have this actionscript on one layer and created the the movieMC and closeMC. I have then put movieMC on one layer and actionscript on another.However this does not work, where am I going wrong, is there another way to do this.

View 2 Replies

Flash :: Autoplay Youtube Video

Feb 23, 2011

i have a site and in the home page i have an embedded youtube video, the div that is containing the player is initially hidden (display:none),so, when a button(video) is clicked, i hide the content of the page and show the youtube player, all works ok, but i would love that when the button(video) is clicked, the player shows up and start to reproduce the video automatically, but i've faild in each attempt, i'm using a code that i find in other web and made some changes

swfobject.addLoadEvent( ytplayer_render_player );
function ytplayer_render_player( )
{[code]....

i've post the entire code i'm using, so, how can i make autoplay here,

View 1 Replies

Flash :: Split Youtube Video ID?

Sep 28, 2011

src="http://www.youtube.com/v/R5zKIOTvfwQ?version=3"

and

src="http://www.youtube.com/v/R5zKIOTvfwQ"

How can I get the video ID alone from this src?

Is there any predefined option available for that?

View 1 Replies

ActionScript 2.0 :: Embed A Youtube Video Into Flash?

Jul 20, 2010

I'm trying to play YouTube videos inside my flash movie.I can get it to load the YouTube player and play the video but the problem is that I cant get it to stop.When I unload the MC I loaded the video into It deletes the player completely but the audio keeps playing.I get a bunch of security warnings when I play it locally, but when I upload it to the server it still doesn�t work.Here�s the AS I am using:

movieMC.loadMovie("http://www.youtube.com/v/q-wf2pP7T0Y");
closeBTN.onPress = function(){
unloadMovie("movieMC");
}

View 10 Replies

Actionscript 3 :: Uploading Video Using The YouTube API Via Flash

Nov 25, 2009

I'm trying to work out how to upload videos to YouTube using the api from flash. There seems to be libraries available for doing this with php, ruby, java etc. but not AS3. point me in the right direction on how to do this?

View 1 Replies

Actionscript 3 :: Embed Youtube Video In Flash CS4?

Apr 26, 2010

Is there any way to play Youtube content in a Flash movie without using a third party plugin?

I'm using Flash CS4 and Actionscript 3.0.

View 1 Replies

Flash :: Php Request Youtube Video Is Not Working?

Feb 25, 2011

what is wrong to this code?

header('Content-type: application/x-shockwave-flash');
$video_id = $_REQUEST['id'];
$content = readfile("http://www.youtube.com/watch?v=$video_id");
echo $content;

Why this code is not working? How should look the code? i've edited like this:

header('Content-type: application/x-shockwave-flash');
$video_id = $_REQUEST['id'];
$content = readfile("http://www.youtube.com/v/$video_id");
echo $content;

and if i get http:[url]...in browser it works but if i add it in jwplayer it doesn't work?

View 1 Replies

Flash - How To Show DIV Over YouTube Video (Z-Index)

Aug 10, 2011

I want to show a div over a YouTube video but can't get it to work. I know that if you set the wmode to transparent or opaque it should work, but I've only seen this work when the <embed> or <object> tag is used. YouTube now embeds the video in an <iframe> so when I tried it, it didn't work.

Here's what my code looks like.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "[URL]">
<html xmlns="[URL]"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
<style type="text/css">@import "reset.css";
[Code] .....

View 1 Replies

ActionScript 2.0 :: Embed Youtube Video In Flash?

Nov 15, 2009

I am trying to embed youtube video in flash. It gets embedded and but the swf gets dead slow after a few seconds. here is my code.[URL]..Also when I jump to anyother frame of the swf file its dont stops and the audio is played continuously.

And I get a lot of security sandbox violation errors as well.

View 0 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved