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();
_mediaElement = _mediaFactory.createMediaElement(new URLResource(_mediaName));
_mediaPlayer.media = _mediaElement;
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);
Thank you for your help again. I understand that structure, I did try it in an earlier version of my code, but my media is mixed and coming from a playlist so there is no telling what the media is (jpg, swf, flv etc.). That was why I used mediaFactory. I think with what you have given me here it would only work on images. Right? I will try it later and get back to you.
Europe, Middle East and Africa