Skip to main content
Inspiring
January 20, 2012
Question

RTMP based HTTP DVR functionality and HLS based iOS functionality

  • January 20, 2012
  • 1 reply
  • 1520 views

I want to use RTMP based HTTP DVR functionality and HLS based IOS functionality, So I need to know how to MPP from my existing DVR app to the livepkgr app so that the stream being recorded at the DVR app can be used by the Flash and Stream MPP over to livepkgr app and can be used by the IOS HLS.

This topic has been closed for replies.

1 reply

Adobe Employee
January 23, 2012

You will have to edit the Application.onPublish(client, stream) method in the dvr_origin app in main.asc..

application.onPublish = function( client, stream )

{

        nc = new NetConnection();

        nc.connect( "rtmp://localhost/livepkgr" );

        ns = new NetStream(nc);

        ns.onStatus = function(info) {

            trace("Stream Status: " + info.code)

            if (info.code == "NetStream.Publish.Start") {

                trace("The 2nd stream is now publishing");

            }          

        }

        ns.setBufferTime(2);

        ns.attach(stream);

        ns.publish( stream.name, "live" );

/// orignal previous code

      streamFullName = stream.type + ":" + stream.name;

    var  dvrstream = application.getStream(streamFullName, true);

    //setup the publisher

    dvrstream.publish(client);

}

Its same mpp code along with the dvr code that existed already.. You just need to connect to the rtmp://localhost/livepkgr and inside ns.publish you may provide publish stream name/event name or other stream options like you provide in FMLE when publish to livepkgr..

This is just a sample code.. but you will also need to do ns.attach(false) in application.onUnpublish (and some other regular clean-up things ) .. so you better store nc and ns in global application variables..

Thanks