2 Replies Latest reply on Jun 15, 2010 10:10 AM by foolish3737

    Noob - Working with DefaultMediaFactory

    foolish3737 Level 1

      Hey all,

      I'm trying to set up a media player using the DefaultMediaFactory but I don't seem to be pulling it off correctly.


      Here is my code:




      import org.osmf.containers.MediaContainer;

      import org.osmf.elements.VideoElement;

      import org.osmf.media.DefaultMediaFactory;

      import org.osmf.media.MediaElement;

      import org.osmf.media.MediaPlayer;

      import org.osmf.media.URLResource;


      private var mediaFactory:DefaultMediaFactory = new DefaultMediaFactory();

      private var mediaContainer:MediaContainer = new MediaContainer();

      private var mediaElement:MediaElement;

      private var urlResource:URLResource = new URLResource("http://mediapm.edgesuite.net/strobe/content/test/AFaerysTale_sylviaApostol_640_500_short.f lv");

      private var mediaPlayer:MediaPlayer = new MediaPlayer();


      private function init():void



      mediaElement = mediaFactory.createMediaElement(urlResource);





      <mx:UIComponent id="mediaPlayerContainer" width="640" height="480" />


      I don't get any errors but the video doesn't display at the same time either.

      See any faults in my code?


      Again, sorry for the newb question (I'm sure I'll have more).