Skip to content

YouTube: option to pause when leaving the screen - #843

Merged
AndreyPavlenko merged 2 commits into
AndreyPavlenko:masterfrom
giunatale:feat/youtube-pause-on-leave
Nov 10, 2026
Merged

AndreyPavlenko merged 2 commits into
AndreyPavlenko:masterfrom
giunatale:feat/youtube-pause-on-leave

Conversation

@giunatale

Copy link
Copy Markdown
Contributor

Fermata (mobile) pauses a YouTube video when it leaves the screen and resumes it on return, while Fermata Auto keeps playing in the background. This makes it a setting, and fixes resuming such a video from outside Fermata. Two commits:

  • Don't enter full screen when YouTube starts playing off screen. Resuming a video from the media notification or Android Auto's card while Fermata is in the background made Fermata enter full screen, as it does whenever a YouTube item starts. That hides the WebView while the full-screen view can't be shown, so the browser paused the video again, and only a second press kept it playing. Full screen is now entered automatically only while the fragment is resumed. Fermata Auto already restores full screen when you return.
  • Add option to pause YouTube when leaving the screen. A new YouTube setting, Pause when leaving the screen. Its default follows each flavour's current behaviour (on for Fermata, off for Fermata Auto), so nothing changes unless it's flipped.

Whether YouTube itself keeps a hidden page playing can depend on the account, since background play is a YouTube Premium feature on the mobile site. Tested with Premium.

Tested in Fermata Auto on a OnePlus 12 (Android 16): with the option on, leaving pauses and coming back resumes; with it off, background play as before. Resuming from the card while off screen now plays on the first press. The mobile flavour wasn't tested on a device; its default behaviour is unchanged.

@AndreyPavlenko

Copy link
Copy Markdown
Owner

Please resolve the merge conflicts.

Resuming a YouTube video from the media notification or Android Auto's
card while Fermata is in the background makes the page report a new
item, and Fermata entered full screen for it. That hides the WebView
while the full screen view can't be shown, so the browser paused the
video again and only a second play kept it going. Enter full screen
automatically only while the fragment is resumed.
Fermata pauses a YouTube video when it leaves the screen and resumes it
when it's back, except in Fermata Auto, which keeps playing in the
background. Make this an option, defaulting to the current behaviour of
each build, so it can be turned on in Fermata Auto or off elsewhere.
@giunatale
giunatale force-pushed the feat/youtube-pause-on-leave branch from 5c7ab68 to 6598eb8 Compare November 8, 2026 15:47
@giunatale

Copy link
Copy Markdown
Contributor Author

Rebased on master and resolved the conflict with #840: both settings are kept, YouTube's controls first, then pause when leaving.

@AndreyPavlenko
AndreyPavlenko merged commit 0b48348 into AndreyPavlenko:master Nov 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants