Thanks for the question. If your livestream is set to record, all recordings are re-encoded as video on demand for later playback (no matter the length)
What you are seeing: When you exit a mobile application that is livestreaming, the livestream broadcast to api.video ends. You’ll want to wait 30-60s before restarting the livestream (to give the backend a chance process video in the buffer and to reset.).
When you come back to stream again - you have started a “new” live stream (using the same livestreamId), and the recording will be saved into a new video file.
As an example, you have a livestream ending in “60d9b1e158ff93d199fd4cbc” I can see in your sandbox account two recordings from that livestream that occurred within the same minute:
Is the issue Android only then? I’d guess whatever livestream plugin you’re using on that platform is ending the stream when you exit the app. I’d see if it can run in the background.
BTW please keep this behavior because it has been so much better than other solutions when it comes to making starting and stopping streams easy and the auto segmenting of the feeds apart from each other.
Thanks for your answers, I have a question related to this point
What you are seeing: When you exit a mobile application that is livestreaming, the livestream broadcast to api.video ends. You’ll want to wait 30-60s before restarting the livestream (to give the backend a chance process video in the buffer and to reset.).
So what if we leave the Livestream in 5-10s then come back and restarting the Livestream ?, in this case, your backend is still not updated the broadcast status right? and we may lose the video ?
We’ve discussed this with your dev team in the past. But yes, we recommend that if you stop a livestream - wait 30-60s before restarting it. If you restart the stream within 10 seconds, our servers are still transcoding video from “session 1” and cannot begin working with “session 2.” The result is that live stream “session 2” will never start.
We are working to improve this by connecting Livestream sessions that stop/reconnect in under a minute into one livestream, and will begin work on this feature later this year.
How can we know the “session 1” has finished already to start “session 2” ? Do you have any API support for this?
When you say we need to wait for the 30s-60s to resuming a Livestream, so if we choose to resume the Livestream after 30s then the new session may also be lost right? so at the end, we still need a way to know when will we can start for the next session.
Livestream webhooks will help you determine when the video starts and stops:
If stream 1 has successfully stopped - it will be saved- and you start stream 2 (it will not be lost). The only reason you “lost:” stream 2 was because stream 1 was still broadcasting. Technically - stream 2 never started on the backend (only one stream can run per livestreamId), so it could never have been recorded.
Did you ever find a way to keep the livestream going in the background on android?
Thanks for your quick reply, we’ll try with these webhooks and contact you later if we need further help.
For your question, as you have already known we tried to use the floating window to make the livestream alive all the time, but unforturnately there’s a sort transform from the foreground to floating windows, it’s just some seconds but enough to make the camera stop for some seconds also and make the streaming is stopped also , so it can’t fix the problem.