0 Replies Latest reply on Jan 19, 2011 2:39 PM by drkstr_1

    Streaming Video with Spark VideoPlayer

    drkstr_1 Level 4



      I'm starting to work with the Flash Media Server for the first time, and I'm having trouble determining if the Spark VideoPlayer component is streaming my video correctly or not.


      First of all, I'm following the tutorial here to set up the stream:





      When I run the example fla, I can see there is a buffer amount which appears to me like the video is streaming as expected.


      (relevent code in FLA)


      var nc:NetConnection = new NetConnection();
      var ns:NetStream = new NetStream(nc);
      nc.onStatus = function(ncObj:Object)
           if (ncObj.code == "NetConnection.Connect.Success")



      However, when I copied this functionality to the Spark VideoPlayer component, the video doesn't appear to buffer as it goes.


                     import org.osmf.events.LoadEvent;
                     protected function videoPlayer_bytesLoadedChangeHandler(event:LoadEvent):void
           <s:VideoPlayer id="videoPlayer" bytesLoadedChange="videoPlayer_bytesLoadedChangeHandler(event)" > 
                <s:DynamicStreamingVideoSource host="rtmp://localhost/VideoTest" > 
                     <s:DynamicStreamingVideoItem streamName="mp4:Vultures"/> 


      When the app runs, videoPlayer_bytesLoadedChangeHandler is called only once and I do not see any buffering indicator in the player control. The video is playing fine.



      Is the video just buffering really quick because I'm running from localhost? If so, why does the original example appear to buffer? Does it have something to do with ns.setBufferTime(2);? Is their an equivilent setting using the VideoPlayer component (I didn't see one in the API reference)? If not, what is a good way to test video streaming from localhost?



      Thanks for your time!