How can I enlarge video fullscreen without the affected interface project in as3?

半世苍凉 提交于 2020-01-05 03:06:33

问题


I have a problem I do not know how to correct it.

I want to work a full-screen in my project. But the video of the entire screen, and I want to show the entire video of the screen appears when you click the button on the control panel only video of a button.

Do not know the solution to the problem I want to help me. I USE this code in AS3:

stage.displayState = StageDisplayState.FULL_SCREEN;
stage.scaleMode = StageScaleMode.NO_SCALE;

Example:

https://drive.google.com/file/d/0B9BcYjTM8tPoMVVOQTJhUl84b3M/view?usp=sharing

Illustrative image:


回答1:


You can not do what you want using the full-screen button of the FLVPlayback component because it's related to the full-screen mode of the stage. Instead, you can use another button in your stage to activate the full-screen mode of your video player.

Take this example where I used two buttons, 1st button to full-screen the whole animation and the 2nd one to full-screen the video when the animation is on full-screen display mode :

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.addEventListener(FullScreenEvent.FULL_SCREEN, function(e:FullScreenEvent){
    // disable the full-screen mode of the FLVPlayback component everytime the stage leaves the full-screen mode
    if(!e.fullScreen){
        player.fullScreenTakeOver = false;
    }
})

// player is my FLVPlayback component

// activate video smoothing (option)
player.getVideoPlayer(0).smoothing = true;

// disable the full-screen mode of the FLVPlayback component
player.fullScreenTakeOver = false;

// this button is to activate the full-screen mode of the FLVPlayback component
btn_player_fullscreen.addEventListener(MouseEvent.CLICK, function(e:MouseEvent){
    // if our stage is on fullscreen mode
    if(stage.displayState == StageDisplayState.FULL_SCREEN){
        // activate the full-screen mode of the FLVPlayback component
        player.fullScreenTakeOver = true;
    }
})

// this button is to activate the full-screen mode of the stage
btn_fullscreen.addEventListener(MouseEvent.CLICK, function(e:MouseEvent){
    if(stage.displayState != StageDisplayState.FULL_SCREEN){
        stage.displayState = StageDisplayState.FULL_SCREEN;
    }
})

You can see this code working here ( I didn't use a skin for my video player ).

Of course, this is just an example to show you a manner to do what you are looking for, you have to improve and adapt it to your specific needs.

Hope that can help.




回答2:


Add <param name="allowFullScreen" value="true" /> in your html embed code(2 times).

Also remove this code stage.displayState = StageDisplayState.FULL_SCREEN;

It will work after you click mouse only.

If you want fullscreen on other button use:

fullScreenButton.addEventListener(MouseEvent.MOUSE_DOWN, fullScreenListener);
function fullScreenListener(e:MouseEvent):void {
    if(stage.displayState == StageDisplayState.NORMAL)
        stage.displayState=StageDisplayState.FULL_SCREEN;
    else
        stage.displayState=StageDisplayState.NORMAL;
}

More info here.

To off FLVPlaybackComponent fullScreenTakeOver use

myVideoPlayer.fullScreenTakeOver = false;



回答3:


Disable scaling

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

Turn off fullScreenTakeOver

flv_playback.fullScreenTakeOver = false;

and enter to the full screen mode

flv_playback.enterFullScreenDisplayState();


来源:https://stackoverflow.com/questions/29138040/how-can-i-enlarge-video-fullscreen-without-the-affected-interface-project-in-as3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!