Skip to main content
November 4, 2010
Question

How to terminate a live stream after N minute at server side?

  • November 4, 2010
  • 1 reply
  • 1452 views

How to apply this kind of logic inside FMS?

    This topic has been closed for replies.

    1 reply

    Adobe Employee
    November 4, 2010

    How are you publishing the livestream? If you are doing server-side play of VOD file - then you can decide to play it "N" minutes at the start itself when you issue play or you can use setInterval. If you using FMLE, you can send unpublish command back after N minutes using setInterval.

    November 5, 2010

    Can you provide a demo how to do it at server side using actionscript?

    Adobe Employee
    November 8, 2010

    I think with FMLE it won't be that straight forward which i thought might be case when i did my first post. So lets take case by case.

    If its VOD playback using Server-side script, you should be able to use play with parameters or use set Interval.

    If its live publish from Flash client, what you can is set an interval and define a function on client end to be called after that interval which will stop the publish.

    For FMLE, you might have to write some kind of script which would stop the publish automatically (i will try to get more info on this)

    For second case of live publish - probably you can write something like below:

    application.onPublish = function(client,stream){

         application.pubInterval = setInterval(stopPublishing, 180000,client)

    }

    function stopPublishing(myclient({

       clearInterval(application.pubInterval);

       myclient(stopPublish,null);   // where stopPublish is client-side handler which is defined on client-end to stop the publishing of stream

    }

    Above code is not best or correct code - just written to give some hint...