Skip to main content
Participant
June 18, 2010
Question

Scrubbing server-side generated playlist

  • June 18, 2010
  • 1 reply
  • 836 views

I am generating a playlist server-side but am having problems when I try and scrub it on the client-side.

Here's the contents of main.asc of my application:

application.onConnect = function(client) {

     this.testStream = Stream.get("mp4:testplaylist");

     this.testStream.play("mp4:test.f4v", 9, 16);

     this.testStream.play("mp4:test2.f4v", 11, 10, false);

     application.acceptConnection( client );

}

Client.prototype.getStreamLength = function( streamName ) {

     return "26"; // hardcoded for now

};

The client calls "getStreamLength" to get the length of the sequence from the server; I do this in order to set the length of the scrub bar correctly.

The problem is when I try and scrub - both forwards and backwards - it doesn't work; the stream just pauses then picks up where it last stopped, regardless of the position of the scrub bar.

Is it possible to scrub a server-side generated playlist using Flash Media Server?

I am using both Flash Player 10 and 10.1 and version 3.5.3 of Flash Media Server.

Thanks

    This topic has been closed for replies.

    1 reply

    Adobe Employee
    June 21, 2010

    Hi,

    Since you are creating a server side playlist and playing this playlist from flash player client using the stream name as "mp4:testplaylist" you must be subscribing it as "live" so point here is that for live streams seek and pause doesnot make any sense. Even if you want to seek or pause then you should first record the stream using  this.testStream.record() then subscribe and play it as "recorded" stream.

    So you can scrub a server side playlist but if it recorded one not live one.

    Regards,

    Amit

    sbuckleAuthor
    Participant
    June 22, 2010

    I have modified the server-side code to look like this, as you suggested:

    application.onAppStart = function() {         this.clientStream = Stream.get("mp4:playlist.f4v");         this.clientStream.record();         this.clientStream.play("mp4:2.f4v", 9, 16);         this.clientStream.play("mp4:4.f4v", 11, 10, false); }

    Then in the player I create the NetConnection and NetStream and have the client make a call something like this:

    ns.play("mp4:playlist.f4v");

    I still get the same problems I was having before. When you say I should play it as a "recorded" stream, how do I do that?

    Is there something I need to set in the application descriptor in FMS to indicated that this is like a VOD application and not a live one?

    Thanks for your help

    Adobe Employee
    June 22, 2010

    Hi,

    On client side use:

    my_ns.play("mp4:playlist.f4v", 0, -1, true);

    Here 0 indicates you are playing recorded file.

    Regards,

    Amit