Skip to main content
dfm_
Known Participant
May 20, 2007 5:31 PM UTC
Answered

progressive download -> stop buffering at X sec.

Hello,
I have custom made flash video player, witch pays (.flv)s. I want to make something like trial of flash video clip. I have flash video clip (.flv) with time length of 30 sec. I want to buffer only to 10 sec. and whe 10th sec. is reatch to stop. So in my buffer memory will have only 1/3 of this (.flv). Is it possible to make? How?

P.S. sorry for my English isn't very good.
    This topic is closed to new replies. Start a new post to keep the conversation going.

    3 replies

    Correct answer
    May 21, 2007 11:42 AM UTC
    dfm_
    dfm_Author
    Known Participant
    May 21, 2007 11:38 AM UTC
    hello, 10x for RQ

    but in help I can't find about publish property of NetStream. Can give some more info.
    Translate
    May 21, 2007 11:27 AM UTC
    DFM,
    An easy way to implement your timer is to use the playheadUpdate method of the FLVPlayback component like this...

    var listenerObject:Object = new Object();
    listenerObject.playheadUpdate = function(eventObject:Object):Void {
    // insert event-handling code here
    };
    my_FLVplybk.addEventListener("playheadUpdate", listenerObject);

    Another way would be to use NetStream.time on the publishing stream something liek this...

    my_ns.attachVideo(active_cam);
    my_ns.publish("SomeData", "live");
    //After 10 seconds, my_ns.time = 10.

    //You then stop publishing the stream.
    my_ns.publish(false);

    //10 seconds later, you publish on the same stream.
    my_ns.publish("SomeData", "live");
    //my_ns.time resets to 0.

    Regards,
    Shack
    Translate