You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Video Picture-in-Picture mute button drawn at the top-left corner (its position is compiled out by picture-in-picture.patch) #56006
I agree to follow the Code of Conduct that this project adheres to.
I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
45.4.1
What operating system(s) are you using?
Windows
Operating System Version
Windows 11 (10.0.26300)
What arch are you using?
x64
Last Known Working Electron version
N/A (the mute button did not exist in the PiP window of Electron 38.8.6, which still had the old PiP controls)
Does the issue also appear in Chromium / Google Chrome?
No
Expected Behavior
In the video Picture-in-Picture window (HTMLVideoElement.requestPictureInPicture()), the mute/volume button is placed at the bottom-right of the bottom controls, on the same row as the timestamp, like in Chrome 156+.
Actual Behavior
The mute button is drawn at the top-left corner of the PiP window, on top of the favicon and of the source title ("File on your device" for a file:// page).
Cause, as far as I can tell: patches/chromium/picture-in-picture.patch wraps the live status / live caption code of VideoOverlayWindowViews::OnUpdateControlsBounds() in #if 0. Upstream, the toggle_mute_button_->SetPosition(...) call sits inside that same block (it is positioned relative to live_caption_button_bounds), so it is compiled out too. The button is still created, because media::kPictureInPictureMuteControl is enabled by default, and is added to playback_controls_container_view_, but it never gets a position and stays at (0,0).
The same #if 0 block is still present on main.
A possible fix: keep computing the bottom-right rectangle that the live caption button would have used (or position the mute button at the bottom-right directly) outside the #if 0, and call toggle_mute_button_->SetPosition(...) from there.
Testcase Gist URL
No response
Additional Information
Minimal reproduction:
Create a BrowserWindow with default webPreferences.
Load a page with <video src="test.mp4" autoplay muted loop>.
From the main process: win.webContents.executeJavaScript("document.querySelector('video').requestPictureInPicture()", true).
Hover the PiP window: the mute button appears at the top-left corner, over the source title. Play/pause, ±10 s, the progress bar, previous/next track, back-to-tab and close are all at their expected places.
Possible workaround (not tested): --disable-features=PictureInPictureMuteControl should remove the button entirely, which loses the volume control.
Activity