feat(mux): mux-video / mux-player migration (phases 1–5, reference only)#1116
Draft
cjpillsbury wants to merge 14 commits intomainfrom
Draft
feat(mux): mux-video / mux-player migration (phases 1–5, reference only)#1116cjpillsbury wants to merge 14 commits intomainfrom
cjpillsbury wants to merge 14 commits intomainfrom
Conversation
…deo sandbox demos Phase 1 of mux-player migration: introduces the core hls.js-based Mux media delegate with a custom CapLevelController, HTML and React MuxVideo components, and sandbox demo templates.
Wire Hls.Events.LEVEL_LOADED in MuxHlsMediaDelegateBase to derive streamType, targetLiveWindow, and liveEdgeOffset from each loaded manifest. Dispatches streamtypechange and targetlivewindowchange CustomEvents on the media element target when values change. - stream-info.ts: getStreamInfoFromLevelDetails() maps LevelDetails to StreamInfo (on-demand / live / unknown, DVR via EVENT type, LL-HLS liveEdgeOffset via partTarget x 2) - index.ts: adds streamType, targetLiveWindow, liveEdgeOffset, liveEdgeStart getters to MuxHlsMediaDelegateBase; resets on src change; uses Object.is() for NaN-safe targetLiveWindow comparison - 13 tests covering VOD, sliding-window live, DVR, and LL-HLS cases Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Standalone test harness for smoke-testing mux-video stream type detection. Shows streamType, targetLiveWindow, liveEdgeOffset, and liveEdgeStart live as the manifest loads, with event logs for streamtypechange and targetlivewindowchange. Preset VOD sources with placeholder slots for live/DVR URLs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds structured error types, hls.js error mapping, 412 retry logic, and pseudo-ended detection to MuxHlsMediaDelegateBase. - errors.ts: MuxErrorCode, MuxErrorCategory, MuxMediaError class, and getErrorFromHlsErrorData() mapping hls.js ErrorData to structured errors. HTTP status codes mapped to MuxErrorCode without JWT inspection (deferred to Phase 6). Full DRM error mapping included. - index.ts: wires Hls.Events.ERROR; 412 retries (6 max, 5s/60s); dispatches muxerror CustomEvent on fatal errors; pseudo-ended getter (paused within 34ms of duration); resets retry state on src change. - 16 tests covering network status codes, DRM error variants, and generic fallthrough cases. - sandbox harness logs muxerror events with muxCode label. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- add `drm.ts`: `getDRMConfig()` builds hls.js drmSystems config for Widevine (with HW_SECURE_ALL robustness), FairPlay, and PlayReady; `toPlaybackIdFromSrc()` extracts playback ID from stream.mux.com URLs - wire DRM into `MuxHlsMediaDelegateBase`: `drmToken` getter/setter; engine is recreated with DRM config when `drmToken` is set before `src` - add `drm-token` observed attribute to `MuxVideo` → flows into delegate - add 14 tests covering URL extraction, DRM config, and key-system func Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- add `mux-embed` dependency to `packages/html`
- add `mux-data.ts`: `setupMuxData()` calls mux.monitor() with hls.js
instance, automaticErrorTracking:false, and custom errorTranslator that
suppresses hls.js internal string-coded events; returns destroyMonitor
cleanup. Also exports `updateMuxHlsEngine`, `emitMuxError`, `emitMuxHeartbeat`
- wire mux monitoring into `MuxVideo` connectedCallback/disconnectedCallback;
re-attaches HLS instance after DRM engine recreation on src change
- add `metadata` property on `MuxVideo` → live heartbeat via mux.emit('hb')
- add `env-key` to observedAttributes; exported `MuxMediaError` from core
- add `src/env.d.ts` to pick up mux-embed ambient type declarations
- add 13 tests covering monitor setup, error translation, cleanup, and emit helpers
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…mitations Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…l details Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
mux.monitor() works without an hlsjs instance — omit the option rather than skipping setup entirely when engine is null. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for vjs10-site ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
This is unintentional duplicate/parallel work. @luwes owns this effort — see his initial merged PR: #1036
Opening as a draft so the implementation approach, planning notes, and any useful code snippets are visible for reference. Please coordinate with @luwes before picking anything up from here.
What's in this branch
An independent port of
@mux/mux-video/@mux/mux-playeronto the VJS v10 delegate + mixin architecture, working from the@mux/playback-coreand@mux/mux-playerelement repo as reference.Completed phases (hls.js path)
MuxHlsMediaDelegate+MuxVideoelement (hls.js config, cap-level controller, native MSE fallback)streamType,targetLiveWindow,liveEdgeOffset,liveEdgeStart) viaLEVEL_LOADEDMuxMediaError,MuxErrorCode, hls.js error mapping, 412 retry logic, pseudo-ended detectiongetDRMConfig()whendrm-tokenis setmux.monitor()wired inMuxVideoconnectedCallback; works on both hls.js and native pathsNot started
playback-idattribute,toMuxVideoURL(),prefer-playback, token attributes)MuxPlayerUIKnown native path gaps (documented in
.claude/plans/mux-player-migration.md)errorevent listener + follow-upfetchfor HTTP status)eme-fairplay.ts+webkit-fairplay.ts)Mux Data monitoring on the native path is implemented (calls
mux.monitor()withouthlsjs).🤖 Generated with Claude Code