Marketplace API / Types
Livestream
ObjectA livestream broadcast on the storefront.
type Livestream implements NodeFields
| Field | Type | Description |
|---|---|---|
activeGiveaway | Giveaway | The giveaway currently running on this livestream, or the most recently completed one when none is running. Null when the livestream has no running or completed giveaway. |
activeHostNote | LivestreamHostNote | This livestream's active host note, or null when none is set. |
agoraRtcSession | AgoraRtcSession | A session on this livestream's video channel. Join the channel with the returned uid, the returned token, and the App ID this storefront's livestreams run on. Request a session for each new connection. The token expires an hour after it is issued, and Agora warns before the privilege expires. To hold a connection open for longer, request another session for the same role and give Agora the new token. A VIEWER must also supply userUid, because its uid is assigned rather than fixed, and a token signed for a different uid does not renew the connection. A channel admits one participant per uid, and Agora disconnects the earlier participant when a second joins on a uid already in use. A VIEWER uid is not compared against the participants the channel already holds, so two viewers can receive the same uid. Request another session and rejoin when a disconnect reports a duplicate uid. Null when no session can be issued for this storefront, with the reason in errors. The livestream's other fields still resolve. A broadcasting part the caller has not proved fails with FORBIDDEN. A VIEWER session or renewal for a signed-in user whom this show kicked fails with FORBIDDEN. HOST_OBS fails with CONFLICT while an encoder key is active for this livestream: the encoder is then the show's video source, and the browser can neither join nor renew until the key is revoked.Arguments:role: LivestreamParticipantRole! — The part this caller plays in the livestream. A broadcasting part is refused unless the caller proved the entitlement it names. VIEWER is open to every caller except a signed-in user whom this show kicked.userUid: NonEmptyString — The uid to renew on, for VIEWER alone. Supply the uid an earlier session returned to sign another token for the same connection, or omit it to be assigned another uid. Every other part has one uid, so repeating the part returns the same uid and needs no value here. Any uid in range is accepted, and it is not checked against the uids this caller was assigned. A uid reserved for another part is refused, so a value here can never reach a broadcast or the recording. Supplying it with any part other than VIEWER is an error. |
channelName | NonEmptyString! | The video channel this livestream broadcasts on. Join it with agoraRtcSession and Marketplace.agoraAppId. |
endedAt | DateTime | When the broadcast ended, or null if it has not ended or the time is unavailable. |
id | ID! | A globally unique ID. Treat this value as an opaque string. |
isMature | Boolean! | Whether this livestream is flagged as containing mature content. |
replayUrl | URL | The playback URL of the livestream recording. The URL is available only when the livestream is ENDED and the streamer has published the replay. Null when there is no published replay or the recording has expired. A recording expires 90 days after the broadcast ends. When the end time is not known, the recording expires 90 days after startAt. |
stage | LivestreamStage | The stage of this livestream: what the show presents. Null when nothing is on stage, and when the product on stage is not available on the storefront. During a show the host can put an item on stage, replace it and take it off. The stage keeps its last item after the show ends. |
startAt | DateTime! | The time the livestream is scheduled to begin, or began. |
status | LivestreamStatus! | Current lifecycle status of the livestream. |
streamer | User! | The user hosting this livestream. |
thumbnailMedia | [Asset!]! | Media to render in the livestream thumbnail slots: an Image (the livestream's own thumbnail, else the streamer's default livestream thumbnail) followed by a Video (the seller's preview video) when both are present. Either may be absent, so match items on __typename rather than position. Empty when neither is set. |
title | String! | The customer-facing title of the livestream. |
url | URL! | The canonical web URL for this livestream. |
viewCounts | LivestreamViewCounts! | View counts for this livestream. |
viewer | LivestreamViewerState | The authenticated user's relationship to this livestream, or null when unauthenticated. |
visibility | LivestreamVisibility! | How the storefront lists this livestream. |