0 Replies Latest reply on Sep 17, 2012 1:46 PM by StardusterII

    Can't get Live Streaming with Flex, OSMF, and Red5 to work

    StardusterII Level 1

      I'm trying to play a live stream from Red5 using the OSMF 2.0 mediaPlayer (and MediaPlayerSprite... which is outdated?) and cannot get it to work. I'm using Flash Buider 4.6. I've tried a number of different approaches, here's the latest that doesn't work... says it's playing but no audio or video.

       

      var netLoader:NetLoader = new NetLoader();

      netLoader.addEventListener(LoaderEvent.LOAD_STATE_CHANGE,onLoaderStateChange);

       

      var videoElement:VideoElement = new VideoElement(new StreamingURLResource(streamName, "live"),netLoader);

      pubVideo = new MediaPlayer(videoElement);

      pubVideo.addEventListener(MediaPlayerStateChangeEvent.MEDIA_PLAYER_STATE_CHANGE, PlayStateChange);

       

      var container:MediaContainer = new MediaContainer();

      container.addMediaElement(videoElement);

      pubVideoContainer.addChild(container);

      ...

      <mx:UIComponent id="pubVideoContainer" />

       

       

      onLoaderStateChange says: Loading, then Ready

      PlayStateChange says: buffering, then playing

       

      What am I doing wrong?