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

[request] Toggle Mute on Window Blur/Focus #336

Open
BBaysinger opened this issue Apr 9, 2015 · 2 comments
Open

[request] Toggle Mute on Window Blur/Focus #336

BBaysinger opened this issue Apr 9, 2015 · 2 comments

Comments

@BBaysinger
Copy link

Should be a way to pause/un-pause playbacks when browser window focus changes. Currently only does so when minimized or switched to a background tab. Seems like this would require a new property on System that would emit the state change in window focus.

@markknol
Copy link
Contributor

There is System.hidden https://aduros.com/flambe/api/flambe/System.html#hidden

I think such feature would work inconsistent for each platform; in flash you lose focus when clicking outside flash, in html on the window focus. If the game isn't fullscreen that will be noticeable.

You can always listen to such features yourself.

#if js
Browser.window.addEventListener("focus", onWindowFocus, false);
Browser.window.addEventListener("blur", onWindowBlur, false);
#end

@BBaysinger
Copy link
Author

System.hidden does not dispatch on window focus changes, only when minimized or switched to background tab. I believe we could make the behaviors consistent between HTML and Flash, maybe by using ExternalInterface to detect focus and blur in JS.

This was a request from our client, and it's come up several times now. I may have time to crack into it after this project, but just want to see if anyone has any thoughts on it.

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

No branches or pull requests

2 participants