Skip to content

Enable auto-pause for Video Cutscenes#2902

Closed
AbnormalPoof wants to merge 2 commits intoFunkinCrew:mainfrom
AbnormalPoof:develop
Closed

Enable auto-pause for Video Cutscenes#2902
AbnormalPoof wants to merge 2 commits intoFunkinCrew:mainfrom
AbnormalPoof:develop

Conversation

@AbnormalPoof
Copy link
Member

@AbnormalPoof AbnormalPoof commented Jun 24, 2024

A pretty small issue I noticed with Video Cutscenes is that they don't seem to pause when the game loses focus, even with the "Auto Pause" option enabled in the Options menu. Looking at the source code, it's kind of obvious why (autoPause is set to false).
Video Cutscenes will now pause on focus loss depending on if "Auto Pause" is enabled or not!

For HTML5, FlxVideo (the method of Video Playback HTML5 uses) doesn't seem to have an autoPause parameter like hxCodec does, so we're just manually pausing and resuming the Video in PlayState's onFocus() and onFocusLost() functions.

Another thing I'd like to mention is that there's a weird bug with autoPause where if you're on the Pause Screen and regain focus, the Video will resume in the background despite the game being paused. I took the liberty of fixing that, basically we just re-pause the video when we regain focus. It's not that elegant, but it does seem to work from the testing I've done.

Before:

before.mp4

After:

after.mp4

@AbnormalPoof
Copy link
Member Author

Accidentally merging into main... please hold.

@AbnormalPoof AbnormalPoof added the status: rejected Issue did not pass review or PR cannot be approved. label Jan 26, 2025
@Hundrec Hundrec added status: duplicate Issue or PR is redundant to another. and removed status: rejected Issue did not pass review or PR cannot be approved. labels May 14, 2025
@EliteMasterEric EliteMasterEric added the size: medium A medium pull request with 100 or fewer changes. label May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: medium A medium pull request with 100 or fewer changes. status: duplicate Issue or PR is redundant to another.

Development

Successfully merging this pull request may close these issues.

3 participants