Skip to content

Commit e11c3ee

Browse files
tsmith512dcpena
andauthored
[Stream] DVR for Live (#19980, SHIP-9848), misc small updates
* [Stream] Add ad playback notice to changelog v1 * [Stream] Initial pass on DVR documentation * [Stream] DVR edits * [Stream] Reformat and minor tweaks * [Stream] Live Clipping is no longer in beta * Update src/content/changelog/stream/2025-02-14-introducing-dvr-for-stream-live.mdx Co-authored-by: Denise Peña <[email protected]> * Update src/content/docs/stream/stream-live/dvr-for-live.mdx Co-authored-by: Denise Peña <[email protected]> * Update src/content/docs/stream/stream-live/dvr-for-live.mdx Co-authored-by: Denise Peña <[email protected]> * Apply suggestions from code review. Thank you, dcpena Co-authored-by: Denise Peña <[email protected]> * [Stream] Documentation updates from code review * Fix * Fix merge conflict * [Stream] the word 'format' looked weird as a headline * s * [Stream] DVR edits after team review --------- Co-authored-by: Denise Peña <[email protected]>
1 parent 4c80659 commit e11c3ee

File tree

5 files changed

+190
-30
lines changed

5 files changed

+190
-30
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: "Rewind, Replay, Resume: Introducing DVR for Stream Live"
3+
description: >
4+
Stream has added support for DVR for Live broadcasts. In other words, for those
5+
who didn’t witness the magic of TiVo, you can now allow your viewers to rewind
6+
and replay Live content during broadcasts.
7+
date: 2025-02-14T12:00:00Z
8+
---
9+
10+
Previously, all viewers watched "the live edge," or the latest content of the
11+
broadcast, synchronously. If a viewer paused for more than a few seconds,
12+
the player would automatically "catch up" when playback started again. Seeking
13+
through the broadcast was only available once the recording was available after
14+
it conluded.
15+
16+
Starting today, customers can make a small adjustment to the player
17+
embed or manifest URL to enable the DVR experience for their viewers. By
18+
offering this feature as an opt-in adjustment, our customers are empowered to
19+
pick the best experiences for their applications.
20+
21+
When building a player embed code or manifest URL, just add `dvrEnabled=true` as
22+
a query parameter. There are some things to be aware of when using this option.
23+
For more information, refer to [DVR for Live](/stream/stream-live/dvr-for-live/).
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
pcx_content_type: how-to
3+
title: DVR for Live
4+
sidebar:
5+
badge:
6+
text: Beta
7+
---
8+
9+
Stream Live supports "DVR mode" on an opt-in basis to allow viewers to rewind,
10+
resume, and fast-forward a live broadcast. To enable DVR mode, add the
11+
`dvrEnabled=true` query parameter to the Stream Player embed source or the HLS
12+
manifest URL.
13+
14+
## Stream Player
15+
16+
``` html title="Stream Player embed format"
17+
<div style="position: relative; padding-top: 56.25%;">
18+
<iframe
19+
src="https://customer-<CODE>.cloudflarestream.com/<INPUT_ID|VIDEO_ID>/iframe?dvrEnabled=true"
20+
style="border: none; position: absolute; top: 0; left: 0; height: 100%; width: 100%;"
21+
allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;"
22+
allowfullscreen="true"
23+
></iframe>
24+
</div>
25+
```
26+
27+
When DVR mode is enabled the Stream Player will:
28+
29+
- Show a timeline the viewer can scrub/seek, similar to watching an on-demand
30+
video. The timeline will automatically scale to show the growing duration of
31+
the broadcast while it is live.
32+
- The "LIVE" indicator will show grey if the viewer is behind the live edge or
33+
red if they are watching the latest content. Clicking that indicator will jump
34+
forward to the live edge.
35+
- If the viewer pauses the player, it will resume playback from that time instead
36+
of jumping forward to the live edge.
37+
38+
## HLS manifest for custom players
39+
40+
``` text title="HLS manifest URL format"
41+
https://customer-<CODE>.cloudflarestream.com/<INPUT_ID|VIDEO_ID>/manifest/video.m3u8?dvrEnabled=true
42+
```
43+
44+
Custom players using a DVR-capable HLS manifest may need additional
45+
configuration to surface helpful controls or information. Refer to your player
46+
library for additional information.
47+
48+
## Video ID or Input ID
49+
50+
Stream Live allows loading the Player or HLS manifest by Video ID or Live Input
51+
ID. Refer to [Watch a live stream](/stream/stream-live/watch-live-stream/) for how to
52+
retrieve these URLs and compare these options. There are additional
53+
considerations when using DVR mode:
54+
55+
**Recommended:** Use DVR Mode on a Video ID URL:
56+
57+
- When the player loads, it will start playing the active broadcast if it is
58+
still live or play the recording if the broadcast has concluded.
59+
60+
DVR Mode on a Live Input ID URL:
61+
62+
- When the player loads, it will start playing the currently live broadcast if
63+
there is one (refer to [Live Input Status](/stream/stream-live/watch-live-stream/#live-input-status)).
64+
- If the viewer is still watching _after the broadcast ends,_ they can continue
65+
to watch. However, if the player or manifest is then reloaded, it will show the
66+
latest broadcast or "Stream has not yet started" (`HTTP 204`). Past broadcasts
67+
are not available by Live Input ID.
68+
69+
## Known Limitations
70+
71+
- When using DVR Mode and a player/manifest created using a Live Input ID, the
72+
player may stall when trying to switch quality levels if a viewer is still
73+
watching after a broadcast has concluded.
74+
- Performance may be degraded for DVR-enabled broadcasts longer than three hours.
75+
Manifests are limited to a maxiumum of 7,200 segments. Segment length is
76+
determined by the keyframe interval, also called GOP size.
77+
- DVR Mode relies on Version 8 of the HLS manifest specification. Stream usesW
78+
HLS Version 6 in all other contexts. HLS v8 offers extremely broad compatibility
79+
but may not work with certain old player libraries or older devices.
80+
- DVR Mode is not available for DASH manifests.

src/content/docs/stream/stream-live/live-instant-clipping.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
---
22
pcx_content_type: how-to
33
title: Live Instant Clipping
4-
sidebar:
5-
badge:
6-
text: Beta
7-
84
---
95

106
Stream supports generating clips of live streams and recordings so creators and viewers alike can highlight short, engaging pieces of a longer broadcast or recording. Live instant clips can be created by end users and do not result in additional storage fees or new entries in the video library.

src/content/docs/stream/stream-live/watch-live-stream.mdx

Lines changed: 79 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,90 @@ sidebar:
1010

1111
import { Render } from "~/components"
1212

13-
When an input begins receiving the live stream, a new video with HLS and DASH URLs is automatically created as long as the mode property for the input is set to `automatic`.
13+
When a [Live Input](/stream/stream-live/start-stream-live/) begins receiving a
14+
broadcast, a new video is automatically created if the input's `mode` property
15+
is set to `automatic`.
16+
17+
To watch, Stream offers a built-in Player or you use a custom player with the
18+
HLS and DASH manifests.
1419

1520
<Render file="chromecast_limitations" />
1621

17-
## Use the API
22+
## View by Live Input ID or Video ID
23+
24+
Whether you use the Stream Player or a custom player with a manifest, you can
25+
reference the Live Input ID or a specific Video ID. The main difference is what
26+
happens when a broadcast concludes.
27+
28+
Use a Live Input ID in instances where a player should always show the active
29+
broadcast, if there is one, or a "Stream has not started" message if the input
30+
is idle. This option is best for cases where a page is dedicated to a creator, channel, or
31+
recurring program. The Live Input ID is provisioned for you when you create the
32+
input; it will not change.
33+
34+
Use a Video ID in instances where a player should be used to display a single
35+
broadcast or its recording once the broadcast has concluded. This option is best for cases where
36+
a page is dedicated to a one-time event, specific episode/occurance, or date.
37+
There is a _new_ Video ID generated for each broadcast _when it starts._
1838

19-
A live input can have multiple video UIDs associated with it. To get the video UID representing the current live stream for a given input, make a `GET` request to the `/stream` endpoint.
39+
Using DVR mode, explained below, there are additional considerations.
40+
41+
Stream's URLs are all templatized for easy generation:
42+
43+
**Stream built-in Player URL format:**
44+
45+
```
46+
https://customer-<CODE>.cloudflarestream.com/<INPUT_ID|VIDEO_ID>/iframe
47+
```
2048

21-
To play the video in your browser, use the URL from the `preview` field. To use your own player, use the `hls` or `dash` URLs.
49+
A full embed code can be generated in Dash or with the API.
50+
51+
**HLS Manifest URL format:**
52+
53+
```
54+
https://customer-<CODE>.cloudflarestream.com/<INPUT_ID|VIDEO_ID>/manifest/video.m3u8
55+
```
56+
57+
You can also retrieve the embed code or manifest URLs from Dash or the API.
58+
59+
## Use the dashboard
60+
61+
To get the Stream built-in player embed code or HLS Manifest URL for a custom player:
62+
63+
1. Log in to your [Cloudflare dashboard](https://dash.cloudflare.com) and select your account.
64+
2. Select **Stream** > **Live Inputs**.
65+
3. Select a live input from the list.
66+
4. Locate the **Embed** and **HLS Manifest URL** beneath the video.
67+
5. Determine which option to use and then select **Click to copy** beneath your choice.
68+
69+
The embed code or manifest URL retrieved in Dash will reference the Live Input ID.
70+
71+
## Use the API
72+
73+
To retrieve the player code or manifest URLs via the API, fetch the Live Input's
74+
list of videos:
2275

2376
```bash title="Request"
2477
curl -X GET \
2578
-H "Authorization: Bearer <API_TOKEN>" \
2679
https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/stream/live_inputs/<LIVE_INPUT_UID>/videos
2780
```
2881

29-
The response contains the HLS/DASH URL that can be used to play the current live video as well as any previously recorded live videos. In the example below, the state of the live video is `live-inprogress` and the state for previously recorded video is `ready`.
82+
A live input will have multiple videos associated with it, one for each broadcast.
83+
If there is an active broadcast, the first video in the response will have a
84+
`live-inprogress` status. Other videos in the response represent recordings
85+
which can be played on-demand.
86+
87+
Each video in the response, including the active broadcast if there is one,
88+
contains the HLS and DASH URLs and a link to the Stream player. Noteworthy
89+
properties include:
90+
91+
- `preview` -- Link to the Stream player to watch
92+
- `playback`.`hls` -- HLS Manifest
93+
- `playback`.`dash` -- DASH Manifest
94+
95+
In the example below, the state of the live video is `live-inprogress` and the
96+
state for previously recorded video is `ready`.
3097

3198
```json title="Response" {4,7,21,28,32,46}
3299
{
@@ -83,32 +150,19 @@ The response contains the HLS/DASH URL that can be used to play the current live
83150
}
84151
```
85152

86-
## Use the dashboard
87-
88-
To get the embed code or HLS Manifest URL for your video:
89-
90-
1. Log in to your [Cloudflare dashboard](https://dash.cloudflare.com) and select your account.
91-
2. Click **Stream** > **Live Inputs**.
92-
3. Click a live input from the list to select it. The page for your live input displays.
93-
4. Locate the **Embed** and **HLS Manifest URL** beneath the video.
94-
5. Determine which option to use and then click **Click to copy** beneath your choice.
153+
These will reference the Video ID.
95154

96-
## View by live input ID
155+
## Live input status
97156

98-
You can use one of the options below to view a live video by input ID:
99-
100-
* Replace the video ID with the input ID.
101-
* Use the Embed code.
102-
* Use the Manifest URL.
103-
104-
## Live input ID status
105-
106-
You can check whether a live input ID is currently streaming a video or not by making a request to the `lifecycle` endpoint. The Stream player supports using input IDs to check a live stream status, but third party players may require additional support.
157+
You can check whether a live input is currently streaming and what its active
158+
video ID is by making a request to its `lifecycle` endpoint. The Stream player
159+
does this automatically to show a note when the input is idle. Custom players
160+
may require additional support.
107161

108162
```bash
109163
curl -X GET \
110164
-H "Authorization: Bearer <API_TOKEN>" \
111-
https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/lifecycle
165+
https://customer-<CODE>.cloudflarestream.com/<INPUT_ID>/lifecycle
112166
```
113167

114168
In the example below, the response indicates the `ID` is for an input with an active `videoUID`. The `live` status value indicates the input is actively streaming.
@@ -141,4 +195,3 @@ After a live stream ends, a recording is automatically generated and available w
141195
While the recording of the live stream is generating, the video may report as `not-found` or `not-started`.
142196

143197
If you are not using the Stream player for live stream recordings, refer to [Record and replay live streams](/stream/stream-live/replay-recordings/) for more information on how to replay a live stream recording.
144-

src/content/release-notes/stream.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ productLink: "/stream/"
55
productArea: Developer platform
66
productAreaLink: /workers/platform/changelog/platform/
77
entries:
8+
- publish_date: "2025-02-10"
9+
title: Stream Player ad support adjustments for Google Ad Exchange Verification
10+
description: |-
11+
Adjustments have been made to the Stream player UI when playing advertisements called by a customer-provided VAST or VMAP `ad-url` argument:
12+
13+
A small progress bar has been added along the bottom of the player, and the shadow behind player controls has been reduced. These changes have been approved for use with Google Ad Exchange.
14+
15+
This only impacts customers using the built-in Stream player and calling their own advertisements; Stream never shows ads by default. For more information, refer to [Using the Stream Player](https://developers.cloudflare.com/stream/viewing-videos/using-the-stream-player/#basic-options).
816
- publish_date: "2025-01-30"
917
title: Expanded Language Support for Generated Captions
1018
description: |-

0 commit comments

Comments
 (0)