-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Close enable screensaver while playing audio files, #4954 #4964
base: develop
Are you sure you want to change the base?
Conversation
I don't think there's a need for allowing to go in screensaver for audio and not for video. Then the options could be simplified into:
This way we can also handle music mode correctly, since maybe someone will play a video file but actually only want the audio, so they enter music mode. Of cause you can even differentiate audio file and music mode and split them into 2 options. |
I will make that change. I struggled with what to name this setting. I based it on how Apple describes the setting we are using, kIOPMAssertionTypeNoDisplaySleep:
I do think the wording needs to make it clear that this only kicks in when playback is active. |
I think I have to make more changes to properly implement this. Is the functionality we normally want for audio/music mode "allow screen saver, but prevent system sleep"? If so, maybe instead of kIOPMAssertionTypeNoDisplaySleep we should switch to using beginActivity and the flags idleDisplaySleepDisabled and idleSystemSleepDisabled. When not suppressing the screen saver for audio we would still not allow the system to sleep. The Another question is whether we should be calling Thoughts? |
I think using
I don't have a strong opinion on this, but maybe I slightly prefer |
I will prepare an update to this that includes switching to Definitely run this past the other developers, especially @saagarjha. |
This commit will: - Add new settings preventDisplaySleepForAudio and preventDisplaySleepForVideo - Change the PlayerCore checkCurrentMediaIsAudio method into an isAudio PlaybackInfo property - Add a "Require display to stay on while actively playing video" checkbox to the settings window General tab - Add a similar checkbox for playing audio - Change the PlayerCore.checkStatusForSleep method to support the new settings - Add logging to SleepPreventer
This commit will: - Add new settings preventScreenSaver and allowScreenSaverForAudio - Change the PlayerCore checkCurrentMediaIsAudio method into an isAudio PlaybackInfo property - Add a "Prevent screen saver from starting while playing" checkbox with a "Not while in Music Mode or only playing audio" subordinate checkbox to the settings window General tab - Change the PlayerCore.checkStatusForSleep method to support the new settings - Change SleepPreventer to use ProcessInfo activities instead of IOPMAssertionCreateWithName - Add logging to SleepPreventer - Remove the "Cannot prevent display sleep!" alert along with the associated suppressCannotPreventDisplaySleep preference. This allows the user to control whether IINA prevents the screen saver from starting when in music mode or just playing audio or allow the screen saver to start and the display to power off and only prevent the system from sleeping. By default IINA will prevent the screen saver from starting when in music mode or playing audio to match the current behavior.
This commit will:
Add new settings
preventDisplaySleepForAudio
andpreventDisplaySleepForVideo
Change the
PlayerCore
checkCurrentMediaIsAudio
method into anisAudio
PlaybackInfo
propertyAdd a
Require display to stay on while actively playing video
checkbox to the settings windowGeneral
tabAdd a similar checkbox for playing audio
Change the
PlayerCore.checkStatusForSleep
method to support the new settingsAdd logging to
SleepPreventer
I have read CONTRIBUTING.md
This implements/fixes issue Enable Screensaver While Playing Audio Files in IINA Media Player #4954.
Description: