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

Enable auto-pause for Video Cutscenes #2902

Closed
wants to merge 2 commits into from
Closed

Enable auto-pause for Video Cutscenes #2902

wants to merge 2 commits into from

Conversation

AbnormalPoof
Copy link
Contributor

@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
Contributor Author

Accidentally merging into main... please hold.

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.

1 participant