Combining the time shifting feature of CSS and the delivery acceleration capability of VOD, time shifting for live stream playback allows users to rewind and play back earlier parts of a live stream. This is commonly used to play back highlights during live streamed sports events. Users can drag the progress bar to view earlier parts of a live stream, and they can also switch back to continue viewing the currently ongoing live stream.
Strengths
Users can specify the delay for playing live content, i.e., the difference between the playback start time and current time.
Users can specify the bitrate for time shifting if a live stream is recorded in multiple bitrates.
Prerequisites
Must-Knows
Before you can use the time shifting feature, you must first enable the feature for a stream. Currently, the smallest time-shift offset is 90 seconds, which means there must be a delay of at least 90 seconds between live content and time-shifted content.
Time shifting relies on the live recording feature. Therefore, you may also incur VOD storage and traffic costs. Directions
Step 1. Activate VOD
2. Agree to the service agreement, and click OK to activate VOD.
Step 2. Add a domain for time shifting
Follow the steps below to add a VOD domain for time shifting:
1. Log in to the VOD console. Select Application Management on the left sidebar and select the target application. Go to Distribution and Playback > Domain Name. 3. Add a CNAME record for the domain.
Step 3. Bind a recording template
2. Click Create Template. For detailed directions, see Live Recording. Note:
Select HLS as the file format.
Step 4. Enable time shifting
You need to submit a ticket to enable the time shifting feature: Select "CSS", make your request, and provide the following parameters: The ID of the recording template created in Step 3. The time-shift period (timeshift_dur
) in seconds.
Note:
Time-shift period indicates how further back you can go in terms of time shifting. The maximum time-shift period allowed currently is 7 days.
This feature may not work exactly according to the period configured. We recommend you set the period a little longer than you actually need.
If the time-shift period is set to 7200
(two hours), you will be able to request content generated as early as two hours ago. (i.e., the value range for playback delay is 90 seconds to 2 hours). If content generated earlier than two hours ago is requested, HTTP 404
will be returned even if there is live streaming content at the requested time.
Playback Request
Request URL format
http://[Domain]/timeshift/[AppName]/[StreamName]/timeshift.m3u8?delay=xxx
Parameter description
|
| The domain you registered for time shifting (the domain you added in the VOD console). |
| This is a fixed field. You don't need to modify it. |
| The application name. For example, if your application is named live , pass in live . |
| The stream name. |
| This is a fixed field. You don't need to modify it. |
| The playback delay (seconds). This parameter cannot be smaller than 90. If you pass in a value smaller than 90, 90 will be used. |
Example
Suppose the time-shift domain name is testtimeshift.com
, application name live
, and stream name SLPUrIFzGPE
. If you need to play back live content generated 5 minutes ago, the request URL should be:
http://testtimeshift.com/timeshift/live/SLPUrIFzGPE/timeshift.m3u8?delay=300
Was this page helpful?