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

[ENHANCEMENT] Enable auto-pause for Video Cutscenes #2903

Merged
merged 2 commits into from
Sep 16, 2024

Conversation

AbnormalPoof
Copy link
Contributor

@AbnormalPoof AbnormalPoof commented Jun 24, 2024

(Re-opening because my dumbass was merging the PR into main instead of develop!!!)
Just found out you could change the base branch... oh well, too late.

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 implemented a simple fix in this PR, 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

@EliteMasterEric EliteMasterEric added status: pending triage The bug or PR has not been reviewed yet. type: enhancement Provides an enhancement or new feature. labels Jun 25, 2024
@AbnormalPoof AbnormalPoof changed the title Enable auto-pause for Video Cutscenes [ENHANCEMENT] Enable auto-pause for Video Cutscenes Jun 28, 2024
@EliteMasterEric EliteMasterEric added type: minor bug Involves a minor bug or issue. status: reviewing internally This PR is under internal review and quality assurance testing and removed type: enhancement Provides an enhancement or new feature. status: pending triage The bug or PR has not been reviewed yet. labels Jun 29, 2024
@EliteMasterEric EliteMasterEric self-assigned this Jun 29, 2024
@EliteMasterEric
Copy link
Member

@EliteMasterEric EliteMasterEric added status: accepted Approved for contribution. If it's not already merged, it may be merged on a private branch. and removed status: reviewing internally This PR is under internal review and quality assurance testing labels Jun 29, 2024
@EliteMasterEric EliteMasterEric added the medium A medium pull request with 100 or fewer changes label Jul 10, 2024
@EliteMasterEric EliteMasterEric deleted the branch FunkinCrew:develop July 12, 2024 01:00
@EliteMasterEric EliteMasterEric added this to the 0.5.0 milestone Jul 12, 2024
@EliteMasterEric EliteMasterEric merged commit 3ce7cd6 into FunkinCrew:develop Sep 16, 2024
@AbnormalPoof AbnormalPoof deleted the develop branch September 28, 2024 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium A medium pull request with 100 or fewer changes status: accepted Approved for contribution. If it's not already merged, it may be merged on a private branch. type: minor bug Involves a minor bug or issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants