Skip to main content
Jan 28, 2011 3:14 AM UTC
Question

How to change the video publish mode seaminglessly?

That is , I don't need to terminate the current publishing video then republish again.

I just want to change the publish mode,maybe from live to recorded mode.

How to do this ?

    This topic is closed to new replies. Start a new post to keep the conversation going.

    3 replies

    Participating Frequently
    Jan 28, 2011 5:09 AM UTC

    Are you looking from publisher context or playback context?

    If its publisher context, i would recommend you to just do live publish and then start & stop recording whenever you want using server-side code. Say you start the publish and start recording on the server & now when you want to make it live again - just stop the recording. But actually "live" feed is all the time available when you are recording too - it all depends on client how it is subscribing in "live" or "record" mode.

    Now if its playback context - you can start playing recorded file and when playback stops, you can switch to live playback.

    Translate
    Jan 28, 2011 8:39 AM UTC

    I'm  looking from publisher context.

    "when you want to make it live again - just stop the recording. "

    That's the part I don't know how to do...

    Translate
    Participating Frequently
    Jan 29, 2011 10:36 AM UTC

    See below code (its not best but would explain something t you atleast:-

    main.asc

    application.onPublish  = function(cobj,sobj){

      application.pubClient = cobj;

      application.pubStream = sobj;

    }

    application.pubClient.startRecord = function(){

         application.pubStream.record();

    }

    application.pubClient.stopRecord = function(){

         application.pubStream.record(false);

    }

    I have not tried the code personally - but i think it should work - can you try it out and let me know.

    In above code, say if publisher publishes stream by name "mystream" , whenever he calls startRecord - it would be available as live as well as recorded mode and once he calls stop record it would be available only in live mode.

    Translate