MediaPlayerSprite (OSMF) not sizing

Kahlil Fitzgerald's Avatar

Kahlil Fitzgerald

19 Jun, 2013 05:34 PM

Hoping someone out there has some OSMF experience. Here is what I am doing

In Config:

contextView.view.addChild(new MediaPlayerSprite(null,null,new CustomMediaFactory()));

In MediaPlayerMediator:

mediaPlayerSprite.width = 100;
mediaPlayerSprite.height = 100;

After this mediaPlayerSprite's width and height are always 0.

Anyone encounter this?

  1. Support Staff 1 Posted by Ondina D.F. on 20 Jun, 2013 08:38 AM

    Ondina D.F.'s Avatar

    Hi Kahlil,

    I have no experience with OSMF, but, in general, I would let an external application expose an API (interface) to allow the communication between it and an rl application.

    Have you seen this example?

    And these discussions?

    If you don’t find an answer in there, let us know.


  2. Ondina D.F. closed this discussion on 27 Jun, 2013 07:57 AM.

  3. Kahlil Fitzgerald re-opened this discussion on 27 Jun, 2013 05:58 PM

  4. 2 Posted by Kahlil Fitzgera... on 27 Jun, 2013 05:58 PM

    Kahlil Fitzgerald's Avatar

    I figured out the sizing issue, the media player is the size of the stage, but I still do not see the video. The following fixed the sizing:

    //Add a new MediaPlayerSprite to the main context view
    var layout:LayoutMetadata = new LayoutMetadata();
    layout.percentWidth = 100;
    layout.percentHeight = 100;
    layout.horizontalAlign = HorizontalAlign.CENTER;
    layout.verticalAlign = VerticalAlign.MIDDLE;
    layout.scaleMode = ScaleMode.LETTERBOX;
    layout.layoutMode =LayoutMode.OVERLAY;

    var container:MediaContainer = new MediaContainer(null,layout);
    container.width = contextView.view.stage.stageWidth;
    container.height = contextView.view.stage.stageHeight;

    var mps:MediaPlayerSprite = new MediaPlayerSprite(null, container, null);

    I have a listener that confirms the mediaPlayerSprite's media Container is on the stage.

  5. 3 Posted by Kahlil Fitzgera... on 27 Jun, 2013 06:49 PM

    Kahlil Fitzgerald's Avatar

    The MediaPlayer sprite is a display object, so I felt it would be most efficient to map it to a mediator and add it to the context view. I have everything setup and working, and can hear sound, but I see no video.

  6. Support Staff 4 Posted by Ondina D.F. on 27 Jun, 2013 10:22 PM

    Ondina D.F.'s Avatar

    Hi Kahlil

    see this:

    It seems the wmode and background are important

  7. 5 Posted by Kahlil Fitzgera... on 28 Jun, 2013 03:00 PM

    Kahlil Fitzgerald's Avatar

    BOOM! Case closed TYVM!

  8. Support Staff 6 Posted by Ondina D.F. on 28 Jun, 2013 03:22 PM

    Ondina D.F.'s Avatar

    BANG! YVW! Discussion closed:)

  9. Ondina D.F. closed this discussion on 28 Jun, 2013 03:22 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac