3 Replies Latest reply on Jul 14, 2011 11:38 PM by Kimi (Catalin Dobre)

    Get Player Size form within a Plugin

    WebAppEngineer Level 1

      Does anyone know how I can get the sixe of the osmf media player itself from within the plugin? Not the media element mind you the player.

        • 1. Re: Get Player Size form within a Plugin
          Bob Wohl Level 1

          Have you tried to look at the properties made available via the display

          object?

           

           

          Bob

          • 2. Re: Get Player Size form within a Plugin
            WebAppEngineer Level 1

            The only display I have been able to access is the display object via the display object trait. This only give the size of the media element not the player.

            • 3. Re: Get Player Size form within a Plugin
              Kimi (Catalin Dobre)

               

              If you get the display object trait then displayTrait.displayObject will point to an object on the Stage ( probably a Video or a Sprite).

               

              If the displayObject is not null then:

              • displayObject.loaderInfo.width — the width of the movie as set in FLA or through SWF metadata
              • displayObject.loaderInfo.height — the height of the movie as set in FLA or through SWF metadata
              • displayObject.stage.stageWidth — the stage width ( the object must be on the stage )
              • displayObject.stage.stageHeight — the stage height ( the object must be on the stage )
              • displayObject.stage.scaleMode — the current scale mode ( the scaleX, scaleY, scaleZ properties offer more information about what happens)


                If the display object is not yet on the stage ( the stage property is null) then you can listen for the "ADDED_ TO_STAGE" event in order to detect that and update your informations.