3 Replies Latest reply on Nov 25, 2009 2:27 AM by Edwin van Rijkom

    How to implement the FULLSCREEN function with OSMF?


      Good day,Everyone!


      Excuse me?

      I am going to implement the FULLSCREEN and  volumeChange function in the player with the OSMF.

      Would you like giving me some advice?


      for the FULLSCREEN function, I have checked the former OVP's implementation method. It is based on the

      flash API using flash.display.* and flash.events.FullScreenEvent.


      When with OSMF, I am using the same method in the DynamicStreamingSample, but nothing happens.

      I cann't find the question.


      How can I do the development to implement these function?


      Expecting for your advice!


      Thanks very much!

        • 1. Re: How to implement the FULLSCREEN function with OSMF?
          Edwin van Rijkom

          Perhaps you'll find this post from the OSMF blog useful:



          Although the sample is about an AIR based OSMF desktop player, its source code archive contains a 'DesktopPlayer.as' file that illustrates how to switch to full-screen mode and back:


          private function onStageKeyUp(event:KeyboardEvent):void
               if (event.keyCode == 70)
                         = (stage.displayState == StageDisplayState.NORMAL)
                              ? StageDisplayState.FULL_SCREEN_INTERACTIVE
                              : StageDisplayState.NORMAL;
          private function onFullScreen(event:FullScreenEvent):void
               if (event.fullScreen)
                    player.visible = false;
                    canvas.x = 0;
                    canvas.y = 0;
                    LayoutUtils.setAbsoluteLayout(canvas.metadata, stage.stageWidth, stage.stageHeight);
                    canvas.x = 38;
                    canvas.y = 32;
                    LayoutUtils.setAbsoluteLayout(canvas.metadata, 760, 493);
                    player.visible = true;


          The 'canvas' variable from the above snippet points to a RegionGateway instance, that is set as the main media element's gateway.


          Hope it's helpful!




          • 2. Re: How to implement the FULLSCREEN function with OSMF?
            zhangxiaohuiFlash Level 1

            Thank you for your help!I have looked into the DesktopPlayer.air example.
            It runs with desktop mode and the interactive key is "f" which shows FullScreen.

            For flash API, it defines "flash.events.FullScreenEvent" and
            I have checked the related docs on FullScreen.
            I want to implement the FullScreen function in the OSMF,and I
            implement it based on the flash API like DesktopPlayer.air example.

            some problem occurred:
            SecurityError: Error #2152: FullScreen mode isn't allowed。
            at flash.display::Stage/set displayState()

            I have checked the index.template.html and modified it just like the bellow.
                            <param name="allowFullScreen" value="true" />
                            <embed src="example.swf" allowFullScreen="true" ... >
            but it doesn't work.

            Will you give me some other advice?

            • 3. Re: How to implement the FULLSCREEN function with OSMF?
              Edwin van Rijkom Level 2

              I think that on going full screen from the web-browser, it is mandatory for the code to be invoked from an interactive event handler (to make sure that movies cannot switch to full screen mode automatically, without the user's intervention). Can you try to run your switching code from a click handler, and see if that solves the problem?




              1 person found this helpful