[RFC] Mux Source & URL DX#1665
Open
R-Delfino95 wants to merge 5 commits into
Open
Conversation
👷 Deploy request for vjs10-site pending review.Visit the deploys page to approve it
|
|
@R-Delfino95 is attempting to deploy a commit to the Mux Team on Vercel. A member of the Team first needs to authorize it. |
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.
Refs #1432
Refs #1431
Refs #977
Summary
Light RFC to align on how
<mux-video>should take a source — and sign, refresh, and derive URLs from it — without the surface changing when the playback engine does. Motivated by signed-token refresh (#1432), under the Mux Media Elements epic (#977). The recommendation is a proposal to react to, not a settled decision.Problem
<mux-video>in v10 has no token surface today: it acceptssrcplus standard HTML5 attributes, and the Mux Data mixin only reads the playback-id out ofsrcfor analytics. So signed playback (JWTs with TTLs) hard-fails mid-session when a token lapses — there's nothing to refresh.Adding that surface forces a DX question with two goals pulling in opposite directions:
playback-id+ signedtokens, and we build thestream.mux.comand thumbnail/poster URLs.src.…under one hard constraint: the surface must stay engine-agnostic (native HLS → hls.js → SPF engine must not change component config).
Recommendation
Option 3 — pluggable source-resolver with optional convenience inputs. Make the middle layer (config → played URL) the contract: raw
srcis the identity base case,playback-id+tokensresolve through the same seam, and that seam is where engine-agnostic re-resolution on token expiry lives. This makes A and B coexist instead of either/or, and gives #1432's refresh a stable home. The recommended default shape is the leanest one — asrcplus an optional token-refresher (noplayback-id), withplayback-id+tokensas heavier opt-in convenience inputs. Options 1 and 2 are just the two ends of Option 3, so it's also the least-committal choice.What I'm looking for
Reactions on the direction, and input on the open questions — chiefly the refresh surface (per-token refresher fn vs
onTokenExpiringevent; reactive vs proactive),src/playback-idprecedence, where the resolver lives, and whether to ship a minimalplayback-tokenpass-through first.Scope notes
<mux-video>runs on hls.js today and is planned to move onto the SPF engine, where Tier-2refreshPlaybackToken(network-resilience.md) will live. The engine-agnostic layering is what keeps that migration invisible to the user.Note
Low Risk
Documentation-only RFC with no production code, config, or behavior changes.
Overview
Adds draft RFC
rfc/mux-source-dx.mdto align on how<mux-video>should accept sources, sign URLs, and refresh signed JWTs without changing the public API when the playback engine switches (hls.js → SPF).The doc frames today’s gap (no token surface;
srcgoes straight to the engine; analytics only derives playback-id fromsrc) and the tension between convenience (playback-id+tokens) vs leansrc, under an engine-agnostic constraint. It recommends Option 3: a pluggable source-resolver middle layer with rawsrcas the base case and optional Mux convenience inputs, plus engine-side refresh (e.g. SPF Tier-2refreshPlaybackToken). Default DX issrc+ optional token refresher;playback-id/tokensstay opt-in.It also outlines follow-ons if accepted (minimal
playback-tokenpass-through, full resolver design, #1432 refresh), reactive vs proactive refresh, thumbnails/poster derivation, and open questions (precedence, refresh API shape, resolver placement). No runtime or API code changes in this PR—documentation only.Reviewed by Cursor Bugbot for commit b526cdd. Bugbot is set up for automated code reviews on this repo. Configure here.