Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

console.lua: add pause_on_open script-opt #15652

Merged
merged 1 commit into from
Jan 5, 2025

Conversation

guidocella
Copy link
Contributor

Add a script-opt to pause when console opens and unpause when it closes, disabled by default.

This is particularly useful for selectors that take several seconds to open so you don't have to guess when to pause, like the subtitle line selector with embedded subtitles, or my script which lets you select which lyrics to download after requesting them with curl.

Copy link

github-actions bot commented Jan 5, 2025

Download the artifacts for this pull request:

Windows
macOS

return
end

was_playing = not mp.get_property_native('pause')
Copy link
Contributor

Choose a reason for hiding this comment

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

Move it before not opts.pause_on_open check, in case the option is changed during console is open. We need to have was_playing is correct state.

Add a script-opt to pause when console opens and unpause when it closes,
disabled by default.

This is particularly useful for selectors that take several seconds to
open so you don't have to guess when to pause, like the subtitle line
selector with embedded subtitles, or my script which lets you select
which lyrics to download after requesting them with curl.
@guidocella guidocella force-pushed the console-pause-on-open branch from 2c85aed to fcb50eb Compare January 5, 2025 20:15
@kasper93 kasper93 merged commit 850e03d into mpv-player:master Jan 5, 2025
26 checks 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