3 Replies Latest reply on May 25, 2010 7:33 AM by Edwin van Rijkom

    Control Bar Separate From Media Player

    ionflow

      Using LayoutMetadata how would I make the control bar vertically position itself below the current MediaElement? I would like the media element to position itself within a given rectangle above the controlbar, like YouTube's player for instance. Answering this question in terms of the OSMFPlayer example would be most helpful. Thanks!

        • 1. Re: Control Bar Separate From Media Player
          ionflow Level 1

          Brian,

          You mentioned in your presentation a few days ago that you had a question out to another developer about this. Just checking to see if there's been any progress. Thanks!

           

          And great presentation!

          • 2. Re: Control Bar Separate From Media Player
            bringrags Level 4

            He's on PTO until Tuesday, hopefully he'll have an answer soon thereafter.

            • 3. Re: Control Bar Separate From Media Player
              Edwin van Rijkom Level 2

              With the OSMFPlayer sample, the main media element gets added to a MediaContainer instance. By changing the layoutMetadata properties of the media element, its position and size can be controlled.

               

              // Set layout metadata:
              var layoutMetadata:LayoutMetadata = new LayoutMetadata();
              layoutMetadata.top = 0;
              layoutMetadata.left = 0;
              layoutMetadata.right = 0;
              layoutMetadata.bottom = 100;
              layoutMetadata.scaleMode = ScaleMode.LETTERBOX;
              layoutMetadata.horizontalAlign = HorizontalAlign.CENTER;
              result.addMetadata(LayoutMetadata.LAYOUT_NAMESPACE, layoutMetadata);
              
              

               

              Inserting the above snippet of code at line 163 of OSMFPlayer.as would results in the content not being shown behind the control bar. The position of the control bar itself can be tweaked by changing the values in the src/assets/configuration.xml file.

              1 person found this helpful