Hi,

I have this problem that I need to play a flash website in full screen mode. That runs fine but then I have a link where we have an FLV video component. Whenever I browse to the link having the FLV video, the video goes fullscreen and fills the whole screen. I want the FLV so that it remains at the original video dimensions while I'm at Full Screen. Any suggestions please. Also I have another problem, if I let the video play in full screen, then when I press escape to get out of video it exits the full screen mode as well, how can I exit the video yet not exit full screen mode.

BTW, I've searched the internet and couldn't find any example of flash where we have flv video in full screen mode website.

Dani AI

Generated

Short summary and practical fixes (builds on , , , and ):

The simplest, most reliable approach is to stop the FLVPlayback from hijacking the screen and manage fullscreen at the Stage level yourself. That way the FLV can be kept at its original pixel size and you retain full control over how and when it is shown/hidden. As and observed, the FLV component can be told not to "take over" the display; if you want an alternative that does not rely on the component, use Stage scaling and manual sizing.

Example (AS3): disable automatic scaling and re-center the player when the stage resizes.

import flash.display.StageScaleMode;
import flash.display.StageAlign;
import flash.events.Event;

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;

var origW:Number = videoContainer.width;
var origH:Number = videoContainer.height;

stage.addEventListener(Event.RESIZE, onStageResize);

function onStageResize(e:Event):void {
    videoContainer.width  = origW;
    videoContainer.height = origH;
    videoContainer.x = (stage.stageWidth - origW) * 0.5;
    videoContainer.y = (stage.stageHeight - origH) * 0.5;
}

About the Escape key: is correct — the player/browser intercepts the Escape key to exit full screen, so you cannot rely on ESC to trigger your own code while in fullscreen. Provide an on-screen "close" button (mouse/touch) to stop/hide the video while leaving the site SWF in fullscreen. If you need finer control, use a Video+NetStream setup (not the component) so you can show/hide and control playback programmatically.

Quick checklist: ensure the HTML embed includes allowFullScreen, avoid windowed wmode values that block fullscreen, set stage.scaleMode before toggling fullscreen, and test on the Flash Player version you target.

Note: Flash Player was deprecated and disabled in browsers after 2020. For long-term compatibility, convert FLVs to an HTML5-friendly format (H.264/MP4 or WebM) and use the HTML5 Fullscreen API and <video> where possible.

Recommended Answers

All 4 Replies

i faced the same problem :(

Hey guy and m.
OK, I think I can help with the escape key thing, but I'm not sure on the video scaling problem.

From what you've said, I'm assuming that you're listening for the escape key in your AS and then firing off some code to navigate away from the video page...If that's the case then the thing to bear in mind is that in flash player, the escape key is bound as a hot-key to exit the full-screen mode.

So, if you've put some code into your movies actionscript to pick up presses of the escape key, then unfortunately flash player will intercept the escape keypress before your .swf does and will interpret that you want to exit fullscreen mode. So the functionality in your swf which you've bound to the escape key will not get called.

Likewise, if you were to try binding some functionality in your movie to the F5 key, so the user presses F5 and your movie does something...In a standalone instance of flashplayer your movie would work fine and would properly pick up and process presses of the F5 button and your bound functionality would be executed....However in most web browsers, F5 is bound to the 'refresh page' functionality. So if you were running your .swf in a browser, your browser would intercept and proceses presses of F5 before your .swf. In other words your browser will refresh the web-page causing your .swf to be reloaded.

If you want the user to press a key to get out of the video, you could try listening for a different keypress in your actionscript.

So that's one point out of the way...I guess the moral there is:
Don't listen for keys in your flash movie which are bound to flashplayer or your browser!

As for the video going full screen when the flash website is viewed full-screen, I'm really not sure what to do there.

Typically, if you have a 400X400 .swf and in it you have a 200X200 flv in the centre of the stage, viewing the .swf full-screen will cause the .swf to go fullscreen and will also cause the flv component to be scaled up proportionally (or perhaps disproportionately, depending on your flv components settings). But I've never seen it cause the flv to go full screen...So I can't help there!

If it's the scaling up which you object to, I've had a quick mess around with Flash 8's flv component (I don't have CS3/4 yet!) and I'm not sure the best way around it..I can't see anything in the flv components properties that can be of any help. I haven't found a way of fixing the flv components size to stop it from being resized when the swf containing it is resized...Probably best to take a look at some of Adobe's forums and ask there..If anybody knows, they should!

Anyways, hope this was of some help to you.
Cheers for now,
Jas.

To prevent the FLVPlayback component from taking over the whole screen when going into full screen mode you can set the fullScreenTakeOver property on the component to false, for example:

my_FLVPlybk.fullScreenTakeOver = false

Hope this helps.

To prevent the FLVPlayback component from taking over the whole screen when going into full screen mode you can set the fullScreenTakeOver property on the component to false, for example:

my_FLVPlybk.fullScreenTakeOver = false

Hope this helps.

ContextClouds,

Thanks for this tip - this worked to solve a problem I was having with a small FLV Logo that would take over the screen when I would activate the FullScreen mode feature in SlideShowPro Component.

Many thanks!

(Now if I could just figure out how to use SSPs halt(): method!!!)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.