Repository navigation
feat: let owners group videos into playlists that play in one embed - #8
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Owners can now group a library's videos into playlists and embed a whole playlist as one player. Viewers move between the videos with an episodes menu that shows each video's description and how much of it they watched. When a video ends, the next one starts by itself after a short countdown. A signed playlist URL covers every video in it, so a signed library needs only one signature per playlist.
Videos get a description, shown in the episodes menu. This PR also restyles the video sheet, moves playback security to its own Security tab, and makes the demo seed create a custom storage in its own bucket.
What owners see
What viewers see
The playlist embed is at
/embed/:libraryId/playlists/:playlistId. It acceptsautoplay,muted,title,t, andv(the video to start with).?v=in the URL follows along.Changes
API
New endpoints, for members and for library API keys:
GET …/libraries/:id/playlistsGET /libraries/:id/playlistsvideos:readPOST …/libraries/:id/playlistsPOST /libraries/:id/playlistsvideos:manageGET …/playlists/:playlistIdGET /libraries/:id/playlists/:playlistIdvideos:readPATCH …/playlists/:playlistIdPATCH /libraries/:id/playlists/:playlistIdvideos:managePUT …/playlists/:playlistId/videosPUT /libraries/:id/playlists/:playlistId/videosvideos:manageDELETE …/playlists/:playlistIdDELETE /libraries/:id/playlists/:playlistIdvideos:managePOST /libraries/:id/playlists/:playlistId/playback-urlsplayback:signPublic, under the library's playback rules:
GET /libraries/:id/playlists/:playlistId/embedBodies.
{ title, description?, videoIds? }.PUT …/videostakes{ videoIds }and replaces the whole list in that order. An empty list removes every video.Signed playback. A playlist is signed for
playlist:<id>, so its signature can't play one of its videos on its own. The embed signs each video's URLs with the same key and expiry.Errors.
playlist.not_foundplaylist.video_not_in_libraryvalidation.failVideo descriptions.
PATCH …/videos/:videoIdnow takes{ title?, description? }, and needs at least one. An empty ornulldescription removes it. Videos and video embeds includedescription.video.updatedentry.Player settings. These have a new
autoplayNextfield, which defaults totruefor libraries saved before it existed.PUT …/playernow requiresautoplayNext. Only the web app calls it.CORS. The library API now allows
PUT. Before, browsers couldn't call the existing chapters and poster endpoints across origins.Activity log. A new
playlistresource type, and theplaylist.created,playlist.updated,playlist.videos_updatedandplaylist.deletedactions. Playlists send no webhooks yet.Migrations
0012_add_playlists_and_video_descriptions.sqlplaylists. Belongs to one library, with a check against blank titles.playlist_items. Stores each video's position in the playlist.library_id, so the database rejects a video of another library.videos.description. New nullable column.player_settingsto includeautoplayNext, and allows the new activity actions and resource type.Shared
PLAYLIST_LIMITS, andVIDEO_FIELD_LIMITS.DESCRIPTION_MAX_LENGTH.playlistTitleSchema,playlistDescriptionSchema,playlistVideoIdsSchemaandvideoDescriptionSchema.playlistEmbedPath, and thevembed query key.textareafield type.Web
VideoPlayertakes aplaylist. New components:PlayerEpisodesMenu,PlayerNextEpisodeButtonandPlayerUpNext.useHlsPlaybackloads a new source into the same<video>and can start it as soon as it loads.PlaylistEmbedPlayer, withuseWatchProgressfor progress kept inlocalStorage.EmbedCodeSection.@dnd-kit).VideoEditDialog,VideoFacts,FigureStripandVideoThumbnail.@dnd-kit/core,sortable,modifiersandutilities, pinned. The lockfile adds only these.Seed
acme-media-videosbucket on the local S3 server, then an "Acme Media bucket" storage with the path templatevideos/{year}/{month}/{libraryId}/{videoId}. It's assigned to "Online courses" before anything is uploaded.