views:

201

answers:

2

I have an *.flv file on a FMS. When I play it on the client side the video plays just fine, but when I call Stream.play(filename, 0, -1, false) on the server side the video turns out really choppy.

I both cases I use NetConnection to connect to an rtmp and NetStream to play the stream, but in one case I connect to a stream and request the server to play my file on that stream. Apparently that doesn't work with files? It works just fine for live streams.

I really don't get why this should differ at all. Any suggestions?

A: 

Making a lot of assumptions (that your player is well built, your interwebz connection fast enough, the .flv is well-formatted for streaming) the problem might be your bufferTime().

Remember that FMS burst-fills the buffer. So there is probably just some lag between bursts and take a look @ your NetStream.setBufferTime(). Maybe try pushing something higher (like 12?)

Jason
Hmm.. That kinda did the trick somehow. It doesn't work when I first stream the video, but it works when I refresh my player for some wierd reason. Anyway.. The bufferTime doesn't really go well with my live streams ;)
Tinelise
Looks like the bufferTime is the best solution =) Thanks!
Tinelise
You can buffer your live streams too; we set ours for 6 seconds. (the trick with live streams is that you need to pass ABSOLUTELY nothing for a start time in the constructor; ie, passing 0 or null will freak it out and break it)
Jason
A: 

Just to clarify. This is what I wanna do, and what I'm currently doing. Example from fms api.


The following example shows how to use Stream.play() as a hub to switch between live streams and recorded streams:

// Set up the server stream.

application.myStream = Stream.get("foo"); 

    if (application.myStream){ 
        // This server stream plays "Live1",  
        // "Record1", and "Live2" for 5 seconds each. 
        application.myStream.play("Live1", -1, 5); 
        application.myStream.play("Record1", 0, 5, false); 
        application.myStream.play("Live2", -1, 5, false);  
    } 

Tinelise