I have a simple HTTP module i use to start and stop recording of my live stream.
Essentially, from my app i send network request with command ‘start’ and inside my module i do
StreamRecorderParameters recordParams = new StreamRecorderParameters(appInstance); recordParams.versioningOption = IStreamRecorderConstants.APPEND_FILE; recordParams.fileFormat = IStreamRecorderConstants.FORMAT_MP4; recordParams.segmentationType = IStreamRecorderConstants.SEGMENT_NONE; recordParams.startOnKeyFrame = true; recordParams.recordData = true; vhost.getLiveStreamRecordManager().startRecording(appInstance, recordParams);
Which starts the recording.
Then, when i get the ‘stop’ command, i stop it with
I want to play local file as a midroll when stream gets paused, so when i get the ‘stop’ command i would do something like
vhost.getLiveStreamRecordManager().stopRecording(appInstance, recordParams); Stream stream1 = Stream.createInstance(vhost, "live", streamName); stream1.play("mp4:sample.mp4", 0, 5, true);
And then when i get the ‘start’ command it should carry on with recording live stream.
I lack the expertise it seems, can someone point me in the rigth direction? Any advice/link to docs would be appreciated.