Adobe flash Youtube Video - actionscript-3

How would i emded a youtube video into a Flash banner, Without the controlls, just a play and pause button on the video and A link to youtube, (it going to be very small.
This i what it needs to look like:
I am using this code now, but i cant se the video due to the bar at the bottom:
import flash.events.MouseEvent;
import flash.net.URLRequest;
Security.allowDomain("www.youtube.com");
var my_player:Object;
var my_loader:Loader = new Loader();
my_loader.load(new URLRequest("http://www.youtube.com/v/wQ-UltJAjMU?version=2"));
//http://www.youtube.com/watch?v=wfU5Hj3uKZ4
//btn_go
btn_go.addEventListener(MouseEvent.CLICK, onLoaderInit);
function onLoaderInit(e:Event):void{
btn_go.visible=false;
addChild(my_loader);
my_player = my_loader.content;
my_player.setSize(106,56);
my_player.addEventListener("onReady");
}
This is what my code makes me:

You need to load the chromeless player (http://www.youtube.com/apiplayer?version=3). Instructions here.
When it's loaded, tell it to play the video you need using player.loadVideoById("wQ-UltJAjMU"). (API reference.)
Edit: or player.cueVideoById("wQ-UltJAjMU") if you need it to load and display the video thumbnail but not start playing automatically.

Related

How to use loadercontext for splashScreenImage?

I understand that for air 3.6+, I MUST declare a loadercontext, may i know if I want a swf for mobile splash screen, how do i achieve it?
var loader:Loader= new Loader();
var lc:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
loader.load(new URLRequest("something.swf"),_lc);
after which in splashScreenImage="", what should i put?
You cant use a SWF as a SplashScreenImage, only an image.
Think about it - the splash page is displayed while the app loads. If you had a SWF as a splash page, you'd need a another splash page to display while your SWF splash page loaded, defeating the purpose of a splash screen.
Also, the image should be embedded, not loaded at runtime.

Flash FLVPlayBack Video goes FULLSCREEN instead of the Application

I am working on a Flash App and its a presentation. I want the App to go full screen but there is an FLVPlayBack component playing a video now instead of the App the StageDisplayState.FULL_SCREEN turns the video to full screen.
When I remove the video it works fine but I need that video there.
Any idea what is going wrong here ?
_Iza
set the fullScreenTakeOver parameter of your FLVPlayback Component to false before the FULL_SCREEN Code. Hope that will resolve that Video takeover issue.
var yourFLVPlaybackComp:FLVPlayback = new FLVPlayback();
yourFLVPlaybackComp.fullScreenTakeOver = false;

Flash projector displays black screen when video played

I'm creating a desktop executable projector file for use in a presentation.
I have set the fscommand to display the projector in fullscreen on launch.
Everything works fine until we get to the video slide at which point whilst in full screen the video slide is totally blacked out, you can't view anything.
If full screen is exited the slide is view able again but the video does not show unless I go forward a slide and then back.
Does anyone know why this would be?
fscommand("fullscreen", "true");
import flash.media.SoundMixer;
import gs.TweenMax;
import gs.easing.*;
stage.addEventListener(KeyboardEvent.KEY_UP, keyHandler);
this.blendMode = BlendMode.LAYER;
stage.scaleMode = StageScaleMode.SHOW_ALL;

Stop embedded swf file

I have a video that is in SWF format and I need to have it embedded in another SWF file. This I have no problem with. The video get's embedded, plays when it need, but I can't figure out how to stop it. My code is like this:
var k:Object = new videoClass();
video = k as MovieClip;
parentObject.addChild(video);
Now, when I want to unload the video I call this:
parentObject.removeChild(video);
video.stop();
video = null;
Sadly, the video does unload but I can still hear the sound playing. Any idea how to fix this? Thanks.
[EDIT] Why not use video into a video format, like FLV ? SWF is not as optimized for video as FLV is.
The loaded SWF have only a static video into it's timeline, or have any programming on it?
Maybe you're dealing with a SWF with code which makes it play it's video.
If that's the case, you can access public methods from it and control it.
var video:MovieClip = new videoClass() as MovieClip;
parentObject.addChild(video);
...
video.publicMethodToStopAllMedia();
parentObject.removeChild(video);

`FullScreenTakeOver` property not working: How can I keep an FLVPlayback out of fullscreen mode in a fullscreen projector?

I have an FLVPlayback component on my timeline (frame 4 or so), and my Flash Projector is running in fullscreen mode. The problem is that I can't seem to make my FLVPlayback component NOT be in fullscreen mode and at the same time, have my stage in fullscreen mode.
Why is this? How do I fix it?
EDIT:
I want the projector to be in fullscreen mode, and the FLVPlayback to not be in fullscreen.
EDIT2:
I'm making an interactive projector in Flash CS5. The projector opens, loads a video into an FLVPlayback component in the first frame. For some reason, that FLVPlayback component does not take over the screen. (I've called flv.fullScreenTakeOver = false; before the video loads. Maybe that's why?)
However, when I try to use an FLVPlayback component in a different frame (frame 4), the video player takes over the screen, showing only a black screen while playing the video. It ignores the fullScreenTakeOver = false.
What could be wrong here and how do I fix it?
it's rather easy to resize the Video instance to e.g. 25% of stage size on FullScreenEvent
UPD: working (but very simple) example on wonderfl.net i check on enter frame, but it's really too often:
video.addEventListener(Event.ENTER_FRAME, updSize);
private function updSize(e:Event = null):void{
video.width = stage.displayState == 'fullScreen' ? smallVidWidth : bigVidWidth;
video.height = stage.displayState == 'fullScreen' ? smallVidHeight : bigVidHeight;
}
imho it's always possible to know when the displayState is changed, but even using a timer would be better then enterframe