Skip to content

fix(webapp): recover shadow playback after recording gaps - #1916

Merged
irvingouj@Devolutions (irvingoujAtDevolution) merged 2 commits into
masterfrom
fix/shadow-player-live-edge
Aug 7, 2026
Merged

fix(webapp): recover shadow playback after recording gaps#1916
irvingouj@Devolutions (irvingoujAtDevolution) merged 2 commits into
masterfrom
fix/shadow-player-live-edge

Conversation

@irvingoujAtDevolution

@irvingoujAtDevolution irvingouj@Devolutions (irvingoujAtDevolution) commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Fixes ShadowPlayer playback getting stuck after a gap in a recording stream.

When screen updates resume, the viewer now continues playback from the latest available video instead of remaining on an earlier buffered segment.

Run live-edge correction after SourceBuffer finishes appending, then use the latest buffered range. Seek slightly behind its end so playback can recover when a recording gap creates multiple ranges.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 6, 2026 21:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR introduces a centralized “catch up to live edge” behavior for ShadowPlayer by triggering a live-edge seek on each SourceBuffer updateend, instead of doing it inline during chunk handling.

Changes:

  • Add live-edge threshold/safety-margin constants and a catchUpToLiveEdge() helper in ShadowPlayer.
  • Extend ReactiveSourceBuffer to accept an optional onUpdateEnd callback invoked on updateend.
  • Wire ShadowPlayer.catchUpToLiveEdge() into ReactiveSourceBuffer’s updateend flow.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
webapp/packages/shadow-player/src/streamer.ts Adds catchUpToLiveEdge() and hooks it into buffer update completion.
webapp/packages/shadow-player/src/sourceBuffer.ts Adds optional onUpdateEnd callback and invokes it on updateend.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread webapp/packages/shadow-player/src/sourceBuffer.ts
Comment on lines +11 to +16
constructor(
mediaSource: MediaSource,
codec: string,
next: () => void,
onUpdateEnd?: () => void
) {
@CBenoit Benoît Cortier (CBenoit) changed the title webapp: recover shadow playback across stream gaps fix(webapp): recover shadow playback after recording gaps Aug 7, 2026

@CBenoit Benoît Cortier (CBenoit) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I adjusted PR title and body to match the repo’s conventions. Feel free to merge once you fixed the Copilot’s comments as appropriate.

Ensure the next buffered chunk is processed even if the live-edge callback throws.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@irvingoujAtDevolution
irvingouj@Devolutions (irvingoujAtDevolution) merged commit ed74e60 into master Aug 7, 2026
117 of 126 checks passed
@irvingoujAtDevolution
irvingouj@Devolutions (irvingoujAtDevolution) deleted the fix/shadow-player-live-edge branch August 7, 2026 17:32
irvingouj@Devolutions (irvingoujAtDevolution) added a commit that referenced this pull request Aug 7, 2026
Bumps `@devolutions/shadow-player` to `0.1.2` to publish the playback
recovery fix from #1916.

`multi-video-player` stays at `0.1.1`; its `^0.1.1` dependency already
accepts this release.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants