Playlists
A playlist is some of a project's videos, in the order you pick, watched one after the other from one link: its watch page, or its player embedded on your site. It has no files of its own. Each of its videos plays as it does on its own page, in the playlist's player, and its views count as the video's.
Playlists take an editor token; a viewer token lists them.
1. Make one
curl https://your-crumbcast/api/v1/projects/$PROJECT_ID/playlists/ \
-H "Authorization: Bearer $CRUMBCAST_TOKEN" \
-H "Content-Type: application/json" \
-d "{
\"title\": \"Getting started\",
\"description\": \"The course, in order.\",
\"video_ids\": [\"$INTRO_ID\", \"$LESSON_1_ID\", \"$LESSON_2_ID\"]
}"
| Field | Without it | |
|---|---|---|
title | Its name, on its watch page too | Required |
description | Up to 2000 characters | None |
video_ids | Its videos, in play order: the project's, up to 500, any of them more than once | None yet |
folder_id | The folder it's kept in, beside videos | The top level |
playback_policy, password | Who may watch it (below) | public |
player | One of the project's players, "default" or "platform": all its videos play in it | "default" |
2. Change it
Update Playlist changes only the fields sent. video_ids
replaces its videos whole: to add one, move one or take one out, send the whole list in
its new order.
curl -X PATCH https://your-crumbcast/api/v1/playlists/$PLAYLIST_ID/ \
-H "Authorization: Bearer $CRUMBCAST_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"video_ids\": [\"$INTRO_ID\", \"$LESSON_1_ID\", \"$LESSON_2_ID\", \"$LESSON_3_ID\"]}"
Deleting a video takes it out of every playlist it's in. Deleting a playlist leaves its videos as they are, but deleting its folder deletes it. Playlists send no webhooks.
3. Play it
| Watch page | https://your-crumbcast/watch/playlist/<playlist id> |
| Embed | https://your-crumbcast/embed/playlist/<playlist id> |
The watch page lists its videos beside the player. The embed is the player alone, with
its videos in a menu among its controls, and takes autoplay, muted, controls,
player and token as a video's embed does (Play videos).
A video that can't play yet, or is gone, is skipped.
An embed plays only the videos any site may embed, those without embed_domains, so it
can be put on any site.
For a player of your own, Get Playlist Playback gives its videos in order, those the caller may watch, each with the token it plays with. Play each by its own links (In a player of your own).
Who may watch it
A public playlist never lets anyone watch a video they couldn't watch from the video's own link. A password or signed one lets its viewers into more of its videos:
| Policy | Who gets it | Which of its videos |
|---|---|---|
public | Anyone with its link | Its public videos |
password | Anyone who gives its password | Its public and password videos: the playlist's password stands in for theirs |
signed | Whoever brings a playback token your backend signed for it | All of them, signed ones too |
A signed playlist's token is made as a video's is (Signed playback),
with the playlist's ID as its sub. A viewer claim in it carries through to its videos,
so a forensic watermark still marks that viewer. Or make a
viewer link with playlist_id.
A player of your own unlocks a password playlist with Unlock Playlist,
as a video's (Password), and passes the token it gets as ?token=.
The project's members, signed in, watch all of a playlist's videos on its watch page, whatever its policy.
In the dashboard, a playlist's page says which of its videos each viewer gets, and which an embed skips.