0 Replies Latest reply on Mar 6, 2010 10:04 PM by crazydeveloper

    MediaPlayerSprite - No Video Output - Sprint 0.9

    crazydeveloper

      Any idea what I'm doing wrong?  I'm using the sprint 0.9 tagged project.

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="1150" height="650"
          backgroundColor="#92be57"
          xmlns:media="org.osmf.media.*"
          xmlns:containers="org.osmf.containers.*"
          xmlns:ns1="sprite.*"
          xmlns:display="org.osmf.display.*">

          <mx:Script>
          <![CDATA[
              import org.osmf.display.ScaleMode;
              import org.osmf.layout.RegistrationPoint;
              import mx.controls.listClasses.ListData;
              import mx.controls.treeClasses.TreeListData;
              import mx.collections.ArrayCollection;
              import mx.controls.Menu;
              import org.osmf.video.VideoElement;
              import org.osmf.net.NetLoader;
              import org.osmf.layout.LayoutUtils;
              import org.osmf.layout.AbsoluteLayoutFacet;
              import org.osmf.utils.URL;
              import org.osmf.media.URLResource;
              import org.osmf.media.DefaultMediaFactory;
              import org.osmf.display.MediaPlayerSprite;
              import org.osmf.containers.MediaContainer;
              import org.osmf.media.MediaPlayer;
              import org.osmf.media.MediaElement;
              import org.osmf.media.MediaFactory;

              private var mediaFactory:MediaFactory;
              private var mediaElement:MediaElement;

              private var factory:DefaultMediaFactory = new DefaultMediaFactory();

              private static const VIDEO_URL:URL
                  = new URL("http://mediapm.edgesuite.net/strobe/content/test/AFaerysTale_sylviaApostol_640_500_short.f lv");

              private function BtnPlay_Click():void {
                  var value:MediaElement = factory.createMediaElement(new URLResource(VIDEO_URL));   
                  mediaPlayerSprite.mediaPlayer.media = value;
                  mediaPlayerSprite.mediaElement = value;
              }
             
          ]]>
          </mx:Script>

          <mx:Button label="Play" click="BtnPlay_Click()" x="100" y="20" />
          <display:MediaPlayerSprite id="mediaPlayerSprite" width="672" height="290" />

      </mx:Application>