Skip to main content
February 8, 2007
Question

Sending streaming recorded FLV to end and stop

  • February 8, 2007
  • 4 replies
  • 254 views
I'm having a surprisingly hard time doing this. I have a recorded FLV which multiple users are simultaneously pushed into starting via a NetStream, streamed off of FMS. What I would like to do is allow the presenter to at any time push everyone, no matter where they currently are in the video, to the very end of the video, and stop the play, and have the last frame/keyframe of the video stay up on their screen. How would this be done?

Thanks.
    This topic has been closed for replies.

    4 replies

    February 9, 2007
    So you mean a Video instance? Video objects don't seem to have a stop() method. duration is also not a property of the NetStream class, it is received via onMetaData. The Video source is a NetStream object, anyway, so I would think I need to stop the NetStream, the Video is just a place to display video.

    At any rate, using seek didn't work because it continues to play. I also tried:

    ns.seek(theDuration-1);
    ns.close();

    and

    ns.seek(theDuration-1);
    ns.pause(true);

    The first wouldn't seek at all, the second would seek but would continue to play after buffer filled. I even tried doing:
    ns.seek(theDuration-1);
    ns.onStatus = function(code){
    if(code=='NetStream.Buffer.Full');
    ns.close();
    }

    To no luck.
    February 9, 2007
    Abeall,
    The videoPlayer is normally a video object created in Flash. You attach the audio and video from a NetStream to the Video object to view/hear the NetStream.

    The seek function positions the stream to the specified period of time and unless u call NetStream.pause or stop, then it will continue to play.

    Regards,
    Bill
    February 9, 2007
    Is "videoPlayer" a component? I'm not using any components... I tried seeking the NetStream, but I find that it continues to play as well. If I close the connection immediately, the NetStream doesn't seek.
    February 8, 2007
    Abeall,
    You would need to have the presenter call a function on each client connected to put the subscribed netstream at the duration point of the stream.

    For example, you could use the NetSetream.send method to send a function call to all subscribers like this:

    // This is on all client NetStreams that are subscribed
    // __ns is the NetSteam that you play
    __ns["owner"] = this;
    __ns.receiveMessage = function(){
    this.owner.__ns.seek(__ns.duration);
    this.owner.videoPlayer.stop();
    }

    // Presenter function to set all clients video player to end of stream
    // __ns is the NetStream that you publish
    private function onSetStreamToEnd():Void
    {
    __ns.call("receiveMessage", null);
    }

    This will only work for non-live streams.

    Shack