Skip to content

fix: video scrubbing on playback - #47703

Merged
codebytere merged 2 commits into
mainfrom
fix-video-playback-scrubbing
Aug 5, 2025
Merged

codebytere merged 2 commits into
mainfrom
fix-video-playback-scrubbing

Conversation

@VerteDinde

Copy link
Copy Markdown
Member

Description of Change

Fixes #47661

This PR slightly modifies an existing patch to MultibufferDataSource to correctly set the supported range on scrub.

Note: There is currently upstream work around MultiBufferNeverDefer v2 which changed this code (see this crbug: https://issues.chromium.org/issues/41161335); future upstream CLs may result in the patch needing to change again in the near future.

Checklist

Release Notes

Notes: Fixed an issue where video scrubbing would not correctly hold the new position on playback.

@VerteDinde
VerteDinde requested a review from a team as a code owner July 9, 2025 20:46
@VerteDinde VerteDinde added semver/patch backwards-compatible bug fixes target/37-x-y PR should also be added to the "37-x-y" branch. target/38-x-y PR should also be added to the "38-x-y" branch. labels Jul 9, 2025
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Jul 9, 2025
@VerteDinde
VerteDinde requested a review from codebytere July 9, 2025 20:46
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Jul 10, 2025
@codebytere codebytere changed the title fix: fix video scrubbing on playback fix: video scrubbing on playback Jul 11, 2025
@danielweck

Copy link
Copy Markdown

hello, what's blocking the merge? Audio/video seeking is broken in Electron 37, 38, 39 (works in 36) when serving media resources via registerStreamProtocol / protocol.handle, we're currently considering a rollback to v36 but we would obviously prefer to release our app with a more current Electron / Chromium revision. Thank you :)

@danielweck

Copy link
Copy Markdown

@codebytere

Copy link
Copy Markdown
Member

@danielweck there is feedback that needs to be incorporated. I'll try to update it today.

@deepak1556 deepak1556 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.

LGTM

@danielweck

Copy link
Copy Markdown

MacOS AppleSilicon arm64 tests fail after 6h CI runtime between:

1694 "iframe using HTML fullscreen API while window is OS-fullscreened can fullscreen from in-process iframes"
and
1695 "navigator.serial does not return a port if select-serial-port event is not defined"

...is that blocking this PR merge?

@codebytere
codebytere force-pushed the fix-video-playback-scrubbing branch from 2048ae8 to 8b868b0 Compare August 1, 2025 13:51
@codebytere
codebytere force-pushed the fix-video-playback-scrubbing branch from 8b868b0 to c0408a4 Compare August 1, 2025 20:27
@codebytere
codebytere merged commit 678fb40 into main Aug 5, 2025
@codebytere
codebytere deleted the fix-video-playback-scrubbing branch August 5, 2025 16:48
@release-clerk

release-clerk Bot commented Aug 5, 2025

Copy link
Copy Markdown

Release Notes Persisted

Fixed an issue where video scrubbing would not correctly hold the new position on playback.

@trop

trop Bot commented Aug 5, 2025

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "37-x-y" cleanly;
you will need to perform this backport manually.

@trop trop Bot added needs-manual-bp/37-x-y and removed target/37-x-y PR should also be added to the "37-x-y" branch. labels Aug 5, 2025
@trop trop Bot mentioned this pull request Aug 5, 2025
@trop

trop Bot commented Aug 5, 2025

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "38-x-y", please check out #47965

@trop trop Bot added in-flight/38-x-y and removed target/38-x-y PR should also be added to the "38-x-y" branch. labels Aug 5, 2025
@danielweck

Copy link
Copy Markdown

I was unable to backport this PR to "37-x-y" cleanly;
you will need to perform this backport manually.

thank you to whoever is going to do this :)

@trop trop Bot added merged/38-x-y PR was merged to the "38-x-y" branch. and removed in-flight/38-x-y labels Aug 5, 2025
VerteDinde added a commit that referenced this pull request Aug 5, 2025
* fix: fix video scrubbing on playback

* chore: address review feedback

---------

Co-authored-by: Shelley Vohr <[email protected]>
@trop

trop Bot commented Aug 5, 2025

Copy link
Copy Markdown
Contributor

@VerteDinde has manually backported this PR to "37-x-y", please check out #47971

VerteDinde added a commit that referenced this pull request Aug 6, 2025
fix: video scrubbing on playback (#47703)

* fix: fix video scrubbing on playback

* chore: address review feedback

---------

Co-authored-by: Shelley Vohr <[email protected]>
@trop trop Bot added merged/37-x-y PR was merged to the "37-x-y" branch. and removed in-flight/37-x-y labels Aug 6, 2025
kigh-ota pushed a commit to kigh-ota/electron that referenced this pull request Sep 30, 2025
* fix: fix video scrubbing on playback

* chore: address review feedback

---------

Co-authored-by: Shelley Vohr <[email protected]>
exceptionel7 pushed a commit to exceptionel7/Exceptionel-Presenter that referenced this pull request Sep 28, 2026
… existing layer stack

Phase 5, steps 4 to 7. The library now reaches the screen.

A renderer never receives a filesystem path and never supplies one. It asks for
`app-media://<assetId>` and main resolves that id against the database. Serving
`file:` instead would widen img-src and media-src to the whole disk and put
`C:\Users\<name>\...` into the DOM of a window that renders imported content. An
id is checked against a row; a path can only be checked against a guess. The
scheme name was already named in security/policy.ts's CSP and is now real.

Resolution goes id -> row -> path on every request, which is not incidental.
Stored filenames contain the content hash, so deleting an asset and importing the
same bytes again reuses the path. A window still holding a deleted asset's URL
must get 404, not its replacement.

The Range header is forwarded to the file fetch. Without it every request returns
the whole file with status 200, Chromium reports `seekable` as 0-0, and setting
currentTime snaps back to zero — a worship video that can only ever play from the
beginning. Electron had its own regression here between 37.0.0 and the fix in
electron/electron#47703 (backported to 37-x-y on 2025-08-06, first released in
37.2.6), so the pin is raised from ^37.0.0 to ^37.3.0.

Backgrounds go through the layer stack that already exists rather than a second
rendering path. `ThemeSpec.background` gains `mediaAssetId` and `fit`; the z2
MEDIA layer in SlideCanvas — the one renderer used by the audience output, both
operator panes, the confidence monitor and the theme gallery — paints an <img> or
a <video> from the protocol URL. Camera-over-lyrics and Scripture-over-camera are
untouched: a background has one kind, so choosing media cannot displace a camera.

Two details in that layer are load-bearing. It is keyed on the ASSET, not the cue,
or advancing a lyric would restart and re-buffer the background video underneath
it. And it is HIDDEN rather than unmounted during a black-out, for the same reason
the camera layer is: coming back from black must resume the loop, not restart it.

Media service items are presentable now, so image and video leave the
NOT IMPLEMENTED set. They become ordinary cues carrying an asset id — the audience
window may not read the library, so one broadcast stays one complete truth. An
item with no file chosen, or whose file was deleted, reports `missing-media`
rather than `not-implemented`: media works, and this is something the operator can
fix on Thursday instead of discovering on Sunday.

Video poster frames are NOT IMPLEMENTED and are labelled as such: nativeImage has
no video decoder, so a video gets no thumbnail. Background video is silent and
looping by design — muted is what makes autoplay work at all, and a loop with its
own audio would talk over the worship leader.

The thumbnail tests caught a real bug: the guard used canBeBackground(), which
excludes logos, so every logo silently lost its preview. Split into isStillImage().

Unverified: nothing in this commit has run in Electron. There is no Electron
binary in the build sandbox, so protocol registration, actual playback and seeking
all need a local run.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/37-x-y PR was merged to the "37-x-y" branch. merged/38-x-y PR was merged to the "38-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't scrub the video served over protocol handler

5 participants