You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/stream/stream-live/watch-live-stream.mdx
+78-27Lines changed: 78 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,23 +10,90 @@ sidebar:
10
10
11
11
import { Render } from"~/components"
12
12
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.
14
19
15
20
<Renderfile="chromecast_limitations" />
16
21
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 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. Best for cases where a page is dedicated to a creator, channel,
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 conluded. 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.
38
+
39
+
Using DVR mode, explaind below, there are additional considerations.
40
+
41
+
Stream's URLs are all templatized for easy generation:
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. Click **Stream** > **Live Inputs**.
65
+
3. Click 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 click **Click to copy** beneath your choice.
68
+
69
+
These will reference the Live Input ID.
18
70
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.
71
+
## Use the API
20
72
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.
73
+
To retrieve the player code or manifest URLs via the API, fetch the Live Input's
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`.
30
97
31
98
```json title="Response" {4,7,21,28,32,46}
32
99
{
@@ -83,32 +150,17 @@ The response contains the HLS/DASH URL that can be used to play the current live
83
150
}
84
151
```
85
152
86
-
## Use the dashboard
153
+
## Live input status
87
154
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.
95
-
96
-
## View by live input ID
97
-
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.
155
+
You can check whether a live input is currently streaming and what its active
156
+
video ID is by making a request to its `lifecycle` endpoint. The Stream player
157
+
does this automatically to show a note when the input is idle. Custom players
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 +193,3 @@ After a live stream ends, a recording is automatically generated and available w
141
193
While the recording of the live stream is generating, the video may report as `not-found` or `not-started`.
142
194
143
195
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.
0 commit comments