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?
    http://www.randytroppmann.com/511

    And these discussions?
    http://knowledge.robotlegs.org/discussions/questions/275-robotlegs-...

    http://knowledge.robotlegs.org/discussions/problems/299-custom-osmf...

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

    Ondina

  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;
    container.addEventListener(Event.ADDED_TO_STAGE,handleContainerAdded);

    var mps:MediaPlayerSprite = new MediaPlayerSprite(null, container, null);
    contextView.view.addChild(mps);

    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:
    http://help.adobe.com/en_US/OSMF/1.0/Dev/WSc6f922f643dd2e6d-5718733...

    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

Generic

? 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