fix: unlock AudioContext on iOS for music playback (#2530)#2906
Open
sungdark wants to merge 5 commits intoFreezingMoon:masterfrom
Open
fix: unlock AudioContext on iOS for music playback (#2530)#2906sungdark wants to merge 5 commits intoFreezingMoon:masterfrom
sungdark wants to merge 5 commits intoFreezingMoon:masterfrom
Conversation
Implement landscape orientation lock using the Screen Orientation API when entering fullscreen mode on mobile devices. This addresses the issue where users had to manually rotate their device, providing a better mobile gaming experience. The orientation is automatically locked to landscape when entering fullscreen and unlocked when exiting.
FreezingMoon#2174) - Display cancel icon temporarily when clicking an active ability that is already used or unusable (require() returns false) - Previously the cancel icon was only shown for passive ability cycling (Joywin case)
…n on projectile impact - Move screen shake from ability activation to projectile onComplete callback - Add hit sound (sounds/swing2) when projectile reaches target - Fixes FreezingMoon#2234: Snow Bunny's Chilling Spit now triggers hit sound and screen shake only when projectile reaches the target, not before
- Add undoCreatureState and undoUsedThisRound to Game class - Add saveUndoState() method to save creature state (position, remainingMove, health, energy) - Add undoMove() method to restore creature to saved state - Modify btnDelay click handler to trigger undo when undo state is available - Add Ctrl+Z hotkey for undo - Hook into move and ability use to save undo state on first action - Reset undo state when new creature activates - Undo is usable only once per round
iOS Safari and Chrome require a user gesture to resume the AudioContext, which starts in a suspended state. This fix adds event listeners that call context.resume() on first user interaction (click, touch, keydown), enabling music and sound effects to play on iOS devices.
|
@sungdark is attempting to deploy a commit to the FreezingMoon Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
iOS Safari and Chrome require a user gesture to resume the AudioContext, which starts in a suspended state. This fix adds event listeners that call
context.resume()on first user interaction (click, touch, keydown), enabling music and sound effects to play on iOS devices.Changes
unlockAudioOnIOS()method to SoundSys classcontext.resume()on first user interactionBounty
Fixes #2530 - no music on iPhone [bounty: 7 XTR]