Time Shifting DVR

Explanation of how to use HLS URLs to access time spent in a live streaming.

Dario Castro avatar
Written by Dario Castro
Updated over a week ago

To talk about this topic we are going to use the commercial or marketing definitions DVR or Time Shifting. Which is nothing more than accessing the content that was part of the live streaming.

Typically used to go back to the start of a show, go to a program from start to finish, or download past content.

First in Mediastream your Live must have contracted the service that stores streaming for hours or days, if Live Editor is activated you already have it.

Here is an example using our web player and also available in our mobile SDK.

DVR by player:

<iframe src='//mdstrm.com/live-stream/[id-live]?autoplay=true&dvr=true' width='640' height='360' allow='autoplay; fullscreen; encrypted-media' frameborder='0' allowfullscreen allowscriptaccess='always' scrolling='no'></iframe>

DVR by URL streaming HLS:

These are the parameters (query string) available in streaming URLs in HLS, the only protocol that has it available today.

This example brings one hour of content (start and end) leaving HLS VOD

https://mdstrm.com/live-stream-playlist/[id-live].m3u8?start=2020-02-04T20:00:00Z&end=2020-02-04T21:00:00Z&dvr=true

This example brings the live in DVR from February 5 (start over). It is important that the player is going to play the first content segment.

https://mdstrm.com/live-stream-playlist/[id-live].m3u8?start=2020-02-05T22:00:00Z&dvr=true

This example brings the live DVR of 600 seconds

https://mdstrm.com/live-stream-playlist/[id-live].m3u8?dvrOffset=600&dvr=true


start = YYYY-MM-DDTHH: MM: SSZ (UTC) Date from content entry point

end = YYYY-MM-DDTHH: MM: SSZ (UTC) Date up to of required content

dvrOffset = SS The time of the dvr window.

dnt = true. To not mark analytics in tests and QA.

dvr = true. Required for the DVR to work.

<iframe src='//mdstrm.com/live-stream/[id-live]?autoplay=true&type=dvr' width='640' height='360' allow='autoplay; fullscreen; encrypted-media' frameborder='0' allowfullscreen allowscriptaccess='always' scrolling='no'></iframe>


Recommendation:

The HLS playlist with DVR playlist is not always played well by the players, our recommendation is that it should not be longer than 3 hours in other players. If you want more than that, develop the capacity in your player to call the URLs as the times go by.


If you have any related question, feel free to write to us.

Att: Mediastream team

Did this answer your question?