YouTube video loaded into Flash MovieClip, can I get width and height? - actionscript-3

I'm trying to load a YouTube video on a flash MovieClip using url
http://www.youtube.com/v/4nRNoXT_gUc that returns the video with player directly.
the video is loaded and i can manage it with his player, the problem is when i try to position it no the stage, because I don't know his width until it starts.
I've tested it with Event.ENTER_FRAME but when the video starts it return width = 10000
how can i do to know his width or height?

You can retrieve the movie's nominal width and height through the loader's contentLoaderInfo object. Just try the following :
trace(loader.contentLoaderInfo.width);
The nominal width and height of your movie is 640x480. You will notice, however, that the movie is being scaled down (probably by YouTube, would need to be confirmed).
Also, be aware that what is returned by YouTube is an AVM1Movie object. An AVM1Movie object is an SWF that was compiled under ActionScript 2 (in YouTube's case, most likely Flash version 8). The interaction that is possible with an AVM1Movie object is much more limited than that of a regular AS3-based swf file.

Related

Youtube embedded player video size issue

We have implemented embedded youtube player in our flash application which is written in action script 3.
We are facing a issue with the display of video. After clicking on play button the video size is displaying 1/4 of the display and shifting to the top left corner of the player display leaving the remaining space as blank.
Reference used for implementing embedded youtube player.
https://developers.google.com/youtube/flash_api_reference
Kindly suggest.
Thanks
From the Iframe API itself, in setting the player size, you should use this:
player.setSize(width:Number, height:Number):Void
It sets the size in pixels of the player. This method should be used instead of setting the width and height properties of the MovieClip. Note that this method does not constrain the proportions of the video player, so you will need to maintain a 4:3 aspect ratio. The default size of the chromeless SWF when loaded into another SWF is 320px by 240px and the default size of the embedded player SWF is 480px by 385px.
Or you can change the width and height value inside the . You can try it here.

Max resolution for video in Flash

I'm working on a standalone app that displays high-resolution video with other movie clips. I am using Flash FLVPlayback component. Not sure what is the max dimensions of video that can be played in Flash?
I'm trying to display a locally stored MP4 video with the dimensions of 5760 x 1080, which is well under the max canvas area limit, but is not displaying properly. I can see a green rectangle where the video should be displayed.

How to play video loop smoothly in as3?

I have to play video loop (2 second HD quality), and there is problem with playing video from the begining because method seek(0) always freeze Flash Player for a moment. There is now way to avoid this problem.
I have an idea, to play 2 netstreams in 2 separeted workers, but dont know how to share stage to do this ;[.
i have same problem.
i have embed the flv video in swf and play it in time line .
with embed vido you can loop it smoothly, this is a good solution in some cases.
(unconditionally embedding the video in swf have performance issue increased when ever your project become more complicated.
another issue is the swf file size become larger and larger
)

as3 - flvplayback component - disable auto buffer?

I'm using the flvplayback component in an AS3 movieclip. I do have the source defined in the compontents properties to a video hosted on Amazon s3.
Now the problem is as soon as the swf loads in a browser it starts downloading/buffering the video even though it's not set to autoplay.
Is it possible to only have it start downloading if the play button is clicked (I do have a custom play button hooked up to player via AS3)? I have 3 separate video players in the swf each with fairly large videos and I don't really want to burn through a ton of bandwidth especially if the user only plays one video.
Thanks!
I haven't used the flvplaybackcomponent, but I'm assuming as soon as you specify a url, it'll start downloading. Try either not setting that until it's been interacted with, or -- do what everyone else does -- place an clickable image on top, then once that's done, create your video player.

embed video in html: using object tag

I have been trying to make my own customized video player for a website, but i don't really get how you are supposed to do. I've watched video's on youtube how you make your own flash player, but they embed the video in it in flash and there must be another way, like creating the player design, then having a html tag telling the video path and stuff. I've seen other video sites like movpod (i use it to watch stuff like the simpsons :p). They have an object tag in their site with the .swf player (design), but if i go to that file, it only shows up the design of the player, not the actual video. They are then using param tags to define the path to the video in the page. My question is, how do you make the player design, without importing a video in like flash cs5 or something, using said said object tag to the design, and params to define what actual video you want to watch.
The params passed are usually FlashVars. It's basically a Parameter in the object or embed tag defining some variables you can access in Flash, i.e. the adress of the video to play. See http://www.permadi.com/tutorial/flashVars/index.html example 1
In Flash then you read the address to the video and load it, i.e. using a FLVPlayback object.