feat(core): add liveEdgeStart and targetLiveWindow properties#1445
Merged
feat(core): add liveEdgeStart and targetLiveWindow properties#1445
Conversation
Made-with: Cursor
|
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. |
Contributor
📦 Bundle Size Report🎨 @videojs/html
Presets (7)
Media (8)
Players (3)
Skins (29)
UI Components (25)
Sizes are marginal over the root entry point. ⚛️ @videojs/react
Presets (7)
Media (7)
Skins (26)
UI Components (20)
Sizes are marginal over the root entry point. 🧩 @videojs/core
Entries (9)
🏷️ @videojs/element — no changesEntries (2)
📦 @videojs/store — no changesEntries (3)
🔧 @videojs/utils — no changesEntries (10)
📦 @videojs/spf — no changesEntries (3)
ℹ️ How to interpretAll sizes are standalone totals (minified + brotli).
Run |
Add JSDoc to `liveFeature` and expand JSDoc on `LiveVideoFeatures` / `LiveAudioFeatures` types and their preset counterparts to call out the new `PlayerFeature<MediaLiveState>` / `liveFeature` additions. Add a `feature-live` reference page to the site mirroring the structure of the other feature reference pages, and register it in the docs sidebar. Made-with: Cursor
Inline the trivial `#setOffset` setter, reuse `#reset()` in the non-live derive branch, drop a redundant `?? null`, and destructure `engine` once in the constructor. In `m3u8-utils`, flatten `resolveFirstMediaPlaylistUrl` with `findIndex`/`find`, remove a redundant `.trim()` before `Number()`, and extract a small `fetchPlaylist` helper to dedupe the fetch + ok + text pattern across the multivariant and media branches. Made-with: Cursor
Merged
This was referenced Apr 27, 2026
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.
Closes #1391
Summary
Expose
liveEdgeStartandtargetLiveWindowon the HLS media delegates (and corresponding store features) so apps can tell how far behind the live edge playback is and whether the stream supports DVR. Modeled after the media-ui-extensions Live Edge proposal and the shape used by@mux/mux-video/ Media Chrome.Changes
HlsJsMediaderives both values fromLEVEL_LOADED(HOLD-BACK/PART-HOLD-BACK, falling back to per-spec multiples ofTARGETDURATION/PART-TARGET).liveEdgeStartis read-derived fromseekable.endeach access;targetLiveWindowemitstargetlivewindowchangeon change.NativeHlsMediafetches the m3u8 onloadstartand parses#EXT-X-PLAYLIST-TYPE,#EXT-X-ENDLIST,#EXT-X-TARGETDURATION,#EXT-X-PART-INFto derive the same values (manifest info isn't exposed via the platform API). Falls back tobufferedwhen Chrome leavesseekableempty.HlsMediabridges both getters and thetargetlivewindowchangeevent from whichever delegate is active.livefeature (liveEdgeStart,targetLiveWindow) wired into the live presets, plusisMediaLiveCapablepredicate.NaNon engine recreation,MANIFEST_LOADING/DESTROYING(hls.js), andemptied(native).Implementation notes
targetLiveWindowsemantics:0= standard live sliding window,Infinity= DVR (EVENTplaylist),NaN= on-demand or unknown.liveEdgeStartis intentionally derived on every read (no cached value / no change event) so it tracks the currentseekable.end, matching the media-ui-extensions spec guidance to re-read whenseekable,targetLiveWindow, orstreamTypechange.native-hls/m3u8-utils.tsand follows the first#EXT-X-STREAM-INFwhen handed a multivariant playlist — mirroring the approach inmuxinc/elements/playback-core.Testing
pnpm -F @videojs/core test— covers derivation for standard live / DVR / VOD / low-latency, seekable-basedliveEdgeStart, multivariant resolution, fetch failures, and reset behavior.Made with Cursor
Note
Medium Risk
Adds new live-edge surface area and events across HLS implementations, including native-HLS playlist fetching/parsing and additional event-driven store updates, which could affect playback behavior and introduce network/CORS edge cases.
Overview
Adds a new live-edge capability (
liveEdgeStart,targetLiveWindow) andtargetlivewindowchangeevent to core media types/state, and wires it intoHlsMediaso apps can detect “at live edge” and DVR vs standard live.Implements derivation for hls.js via a new
HlsJsMediaLiveMixin(driven by manifest/level events) and for native HLS via a newNativeHlsMediaLiveMixinthat fetches/parses.m3u8playlists (including following the first variant of master playlists) and resets state on teardown/source changes.Extends the DOM store with a new
liveFeature(added to live audio/video presets) plusselectLive, and adds tests/docs covering derivation, reset behavior, and parsing utilities.Reviewed by Cursor Bugbot for commit fe95d8f. Bugbot is set up for automated code reviews on this repo. Configure here.