Based on the LVB recording capability, the time shifting feature stores the TS (Transport Stream) segment addresses and TS files separately into the VOD system. A client can replay video content before the current time point by passing in a time parameter in the URL with the time-shift playback domain name.
In a common live broadcast in HLS format, the pushed video content is sliced into multiple TS segments. When a viewer watches it, the TS segment addresses are accessed by requesting the .m3u8 files to get the TS files. In this case, because the TS files are not persisted, the viewer cannot replay the live video content before the current time point.
Fees for VOD traffic and storage will be incurred when you enable the time shifting feature.
To add the Tencent Cloud VOD domain name for time-shift playback, perform the following:
Enter VOD Console > Distribution & Playback Management > Domain Names.
Click Add Domain Name and enter the VOD domain name. For more information, please see Distribution and Playback Settings
Configure the new domain CNAME.
Log in to the LVB Console and go to Function Template > Recording Configuration.
Click + to create a recording template. For more information, please see Recording Configuration.
Note:
- Choose HLS for the file type.
- Define the file storage duration, which should be no less than the time-shift duration
Associate the recording template with the push domain name to be configured. For more information, please see Recording Configuration.
Go to the ticket system to submit a ticket. Select “LVB” and request to activate time shift feature and provide the following parameters:
timeshift_dur
in secondsNote:
- Time-shift duration, which refers to the maximum time-shift duration (up to 7 days currently).
- The defined duration may not take accurately. We recommend that you adding a little buffer.
- Suppose the duration is configured as 7200 (2 hours), you will be able to request time-shifted contents generated less than 2 hours ago (
delay
, or the time-shift duration will range from 90 seconds to 2 hours). When any content generated more than 2 hours ago is requested,HTTP 404
will be returned even if there is live streaming content.
Request URL format
http://[Domain]/timeshift/[AppName]/[StreamName]/timeshift.m3u8?delay=xxx
Parameter | Description |
---|---|
[Domain] | The registered domain name of the time shifting feature, namely, the time-shift playback domain name you added to the VOD console. |
timeshift | Fixed field which needs no modification |
[AppName] | Application name. Suppose your application name is live , then enter live |
[StreamName] | Stream name. You need fill in the stream name of your request |
timeshift.m3u8 | Fixed field which needs no modification |
delay | The time-shift duration in seconds. This value is larger than or equals to 90. It will default back to 90 if the configured value is less than 90. |
Suppose current time-shift domain name is testtimeshift.com
, time-shift application name is live
and the stream name is SLPUrIFzGPE
. If you need to play back live content generated five minutes ago, the request URL should be:
http://testtimeshift.com/timeshift/live/SLPUrIFzGPE/timeshift.m3u8?delay=300
Was this page helpful?