fix(player): resume live ts streams without range#593
Conversation
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-593.eastasia.1.azurestaticapps.net |
There was a problem hiding this comment.
Pull request overview
This PR updates the web UI MPEG-TS player/worker pipeline so single-URL continuous live TS streams recover from backpressure by restarting with a fresh GET (instead of resuming via byte-Range), and replaces watermark polling with event-driven backpressure updates.
Changes:
- Add a
ContinuousLiveSegmentSourcefor single-URL live TS streams and introduceSourceModein the worker pipeline to drive resume behavior. - Extend
FetchLoaderwith aresumeModeoption ("range"vs"restart") and a newonRestartedcallback to reset TS input state on restart. - Drive backpressure recovery from
timeupdate+ SourceBufferupdateend(viaonBufferUpdated) instead of an interval timer.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| web-ui/src/mpegts/worker/segment-source.ts | Adds a segment source for continuous single-URL live TS that yields an endless stream of “new cycle” metas. |
| web-ui/src/mpegts/worker/pipeline.ts | Introduces source mode selection and wires "restart" resume semantics + TS input boundary handling for continuous live TS. |
| web-ui/src/mpegts/player/mse.ts | Adds onBufferUpdated hook fired from SourceBuffer updateend. |
| web-ui/src/mpegts/player/mpegts-player.ts | Replaces polling-based watermark throttle with event-driven backpressure updates and unifies pause/resume handling. |
| web-ui/src/mpegts/io/fetch-loader.ts | Adds restart resume mode and restart callback to support fresh-GET recovery. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7b5e38f2a0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-593.eastasia.1.azurestaticapps.net |
18a8d26 to
decf29f
Compare
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-593.eastasia.1.azurestaticapps.net |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-593.eastasia.1.azurestaticapps.net |
1 similar comment
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-593.eastasia.1.azurestaticapps.net |
def43c0 to
f3db6ee
Compare
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-593.eastasia.1.azurestaticapps.net |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-593.eastasia.1.azurestaticapps.net |
What changed
This updates the web player live TS backpressure path so a single-URL live TS stream resumes with a fresh GET instead of a byte Range request. The fresh request is treated as a TS input boundary, reusing the same overlap/gap normalization behavior used by static TS segment lists.
The player now drives buffer-full recovery from
timeupdateand SourceBufferupdateendevents instead of a polling timer. HLS keeps its discrete segment behavior: HLS VOD still uses forward-buffer throttling, and HLS live remains playlist-driven.Why
Live TS URLs do not support byte-range continuation semantics. After buffer pressure aborts a request, resuming with Range can restart the stream in a way that looks like TS discontinuity and can corrupt the output timeline. HLS segments have different semantics, so the reconnect behavior must stay isolated to continuous live TS.
Validation
pnpm exec biome check web-ui/src/mpegts/player/mse.ts web-ui/src/mpegts/player/mpegts-player.ts web-ui/src/mpegts/worker/pipeline.tspnpm run type-check:tscpnpm exec vite build web-uisrc/embedded_web_data.hand local test assets are intentionally not included.