从全屏使用全屏使用视频esc最小化flex中的整个应用程序 [英] esc from fullscreen using video in full screen minimizes whole app in flex

查看:269
本文介绍了从全屏使用全屏使用视频esc最小化flex中的整个应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下的问题,我有一个全屏的应用程序,为了防止它从全屏幕我没有:

  protected function windowedapplication_preinitializeHandler(event:FlexEvent):void 
{
nativeWindow.stage.addEventListener(KeyboardEvent.KEY_DOWN,onKeyDown);
nativeWindow.stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;


保护函数onKeyDown(event:KeyboardEvent):void
{
if(event.keyCode == 27)
{
event.preventDefault();


$ / code
$ b $ p
$ b $ p

防止应用程序离开全屏,但是我的应用程序有一个视频播放器,可以选择全屏与视频,在这一点上,当我按esc整个应用程序和视频来的小尺寸..我可以做什么??
$

解决方案

您可以侦听FullScreenEvent并将stage.displayState设置为返回当FullScreenEvent.FULL_SCREEN被调度时,全屏显示。



这样,即使用户点击全屏按钮退出全屏模式,应用程序也会变回全屏显示在视频播放器中。

  private function onApplicationComplete(event:Event):void {

stage。 displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
stage.addEventListener(FullScreenEvent.FULL_SCREEN,onFullScreenChange);


$ b private function onFullScreenChange(event:FullScreenEvent):void {

stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
}


i have the following problem, i have an application in full screen and in order to prevent it from getting out of full screen i did:

protected function windowedapplication_preinitializeHandler(event:FlexEvent):void
{
     nativeWindow.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
     nativeWindow.stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
}

protected function onKeyDown(event:KeyboardEvent):void
{
   if (event.keyCode == 27)
   {
      event.preventDefault();
    }
}

which prevents the app getting out of fullscreen but my app has a video player with an option to go full-screen with the video and at that point when i press esc the whole app and the video come to smaller size..what can i do??

Thanks in advance!

解决方案

You can listen for the FullScreenEvent and set the stage.displayState to return back to full screen when FullScreenEvent.FULL_SCREEN is dispatched.

This way, the app will change back to full screen even when the user clicks the full screen button to exit full screen mode in the video player.

private function onApplicationComplete(event:Event):void{

      stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
      stage.addEventListener(FullScreenEvent.FULL_SCREEN, onFullScreenChange);

}

private function onFullScreenChange(event:FullScreenEvent):void{

      stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
}

这篇关于从全屏使用全屏使用视频esc最小化flex中的整个应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆