Skip navigation
TezS56
Currently Being Moderated

OSMF Duration Element

Sep 6, 2011 9:16 AM

Can someone PLEASE point me in the right direction. I am trying to add a duration to a media element when a JPEG is shown. Where and how do I add this to the Media Player? This is my code snippet:

 

_mediaContainer = new MediaContainer();
            this.addChild(_mediaContainer);
           
            _mediaElement = _mediaFactory.createMediaElement(new URLResource(_mediaName));

            _mediaPlayer.media = _mediaElement;
           
            _mediaContainer.addMediaElement(_mediaElement);

 

 

Thanks

 
Replies
  • Currently Being Moderated
    Sep 7, 2011 2:42 AM   in reply to TezS56

    An example for 3 seconds duration:

    var mediaPlayerSprite:MediaPlayerSprite = new MediaPlayerSprite();
    var imageElement:ImageElement = new ImageElement(new URLResource("your.jpg"));
    var durationElement:DurationElement = new DurationElement(3, imageElement);
    mediaPlayerSprite.media = durationElement;
    addChild(mediaPlayerSprite);
    
     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points