8 Replies Latest reply on Nov 1, 2010 2:17 AM by markcorbyn

    s:VideoPlayer not 100% size after exiting fullscreen

    markcorbyn

      Hi,

       

      I'm having a problem with the VideoPlayer size shrinking down when exiting full screen.

      I have the VideoPlayer included with width 100% and height 100% which fills the browser window nicely.  However after hitting the full screen button and the Esc, the VideoPlayer shrinks down to a tiny size (seems to be the size of the original video file, or perhaps the VideoPlayer "default" size).

       

      This simple appplication produces the error:

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application name="Spark_VideoPlayer_skinClass_test"
                     xmlns:fx="http://ns.adobe.com/mxml/2009"
                     xmlns:s="library://ns.adobe.com/flex/spark"
                     xmlns:mx="library://ns.adobe.com/flex/halo">

       

         
          <s:VideoPlayer id="videoPlayer"
                         source="http://helpexamples.com/flash/video/cuepoints.flv"
                         width="100%"
                         height="100%" />
         
      </s:Application>

       

       

      I'm using FF3.6.3, Flash Player 10,1,52,14  on Mac OSX Snow Leopard.


      Is this a known issue?  Does anyone have a solution?  Presumably there is some sort of "re-initailise" call or something I can make?

       

      Thanks,

      Mark

        • 1. Re: s:VideoPlayer not 100% size after exiting fullscreen
          Shongrunden Adobe Employee

          I'm seeing this as well on Firefox 3.6.3 with Flash Player 10,1,53,21 (debug) on Mac OSX and Windows.  Can you please file a bug for this issue and post the link here? (Or let me know if you would rather that I file it.)

           

          http://bugs.adobe.com/flex/

          • 2. Re: s:VideoPlayer not 100% size after exiting fullscreen
            Shongrunden Adobe Employee

            As a workaround you might be able to resize the VideoPlayer after seeing a FullScreenEvent: http://www.adobe.com/livedocs/flex/201/langref/flash/events/FullScreenEvent.html

            • 3. Re: s:VideoPlayer not 100% size after exiting fullscreen
              markcorbyn Level 1

              Thanks, I'll give the event listener a try.

              I'll report it as a bug when I get a moment.

               

              Cheers,

              Mark

              • 4. Re: s:VideoPlayer not 100% size after exiting fullscreen
                markcorbyn Level 1

                I gave the FullScreenEvent idea a try however the event doesn't seem to get dispatched by the component.

                 

                According to the docs at http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/components/VideoP layer.html the following are the events that get dispatched:

                 

                    Events
                    bytesLoadedChange="No default"
                    complete="No default"
                    currentTimeChange="No default"
                    durationChange="No default"
                    mediaPlayerStateChange="No default"

                I'm still new to Flex, but perhaps attaching something to the Esc key press and the "Full Screen Button" key press which forces the size of the video player again?

                 

                Thanks,

                Mark

                • 6. Re: s:VideoPlayer not 100% size after exiting fullscreen
                  markcorbyn Level 1

                  Yes that is the same issue.


                  The problem still exists for me.  The closest I have gotten to a solution is adding a stage resize handler the video.  Although I was having issues with the video not scaling back down after the foolowing steps were taken (I'm not ruling out a bug in my code being the issue in this case):

                   

                  1. Load page to see video fill the browser window

                  2. Resize the browser window smaller and larger to ensure the resizing is working

                  3. Hit the full screen button to see the movie go full screen

                  4. Exit from fullscreen by clicking the button or hitte Esc key

                  5. Observe the video still fills the browser window

                  6. Enlarge the browser window to see the video expand to fill the window

                  7. Resize the window smaller to see the video DOESN'T skrink back again

                   

                  My sample code is now as follows:

                   

                  <?xml version="1.0" encoding="utf-8"?>

                   

                  <s:Application name="Spark_VideoPlayer_skinClass_test"

                                 xmlns:fx="http://ns.adobe.com/mxml/2009"

                                 xmlns:s="library://ns.adobe.com/flex/spark"

                                 xmlns:mx="library://ns.adobe.com/flex/halo"

                                 applicationComplete="init()">

                    

                      <fx:Script>

                          <![CDATA[


                              /**

                               * Initialise the app

                               */

                              private function init():void {

                                  stage.addEventListener(Event.RESIZE, resizeVideoHandler);

                              }

                   

                   

                              /**

                               * Keep the video size at 100%

                               */

                              private function resizeVideoHandler(event:Event = null):void {

                   

                                  if (videoPlayer.videoObject) {

                                      if ((videoPlayer.width != applicationContainer.width || videoPlayer.height != applicationContainer.height)) {

                                          videoPlayer.width = applicationContainer.width;

                                          videoPlayer.height = applicationContainer.height;

                                      }

                                  }

                              }

                          ]]>

                      </fx:Script>

                   

                   

                      <s:Group id="applicationContainer" width="100%" height="100%">

                          <s:VideoPlayer id="videoPlayer"

                                 source="http://helpexamples.com/flash/video/cuepoints.flv"

                                 width="100%"

                                 height="100%"

                                 updateComplete="resizeVideoHandler();" />

                      </s:Group>


                  </s:Application>

                   

                  Any further advice would be appreciated.

                   

                  Thanks,

                  Mark

                  • 7. Re: s:VideoPlayer not 100% size after exiting fullscreen
                    Mike_Dobs Level 1

                    What I did after alot of searching was:

                     

                    Listening to the FULL_SCREEN event at the systemManager

                     

                    systemManager.stage.addEventListener(FullScreenEvent.FULL_SCREEN,function(e)
                                    {
                                        var event = e.fullScreen;
                                        if(event==false)
                                        {
                                            player.percentHeight=100;
                                            player.percentWidth=100;
                                            player.invalidateDisplayList();
                                        }trace(e);
                                    });

                    and if it is about to close I re-enter the percentages for the player height and width, and it again works as expected.

                     

                    I hope this helps....

                    • 8. Re: s:VideoPlayer not 100% size after exiting fullscreen
                      markcorbyn Level 1

                      Brilliant, that fixes it for me.  I've been long awaiting the solution to this.

                      It has actually been marked as fixed recently in http://bugs.adobe.com/jira/browse/SDK-26331 although I'm sure it will take some time to filter through to the release build.

                       

                      Thanks Mike!