-
Notifications
You must be signed in to change notification settings - Fork 4
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
Sound Disappears when two tabs are open in landscape #199
Comments
I just ran a test with some debug code and found that the audio context is being placed in the "interrupted" state in this case. This is also what we saw sometimes when going into full screen mode in Safari, see #190. |
Since this problem was occurring on mobile Safari, I wanted to make sure that it wasn't happening on the non-mobile version. I tested on PhET's MacBook Pro "Dirac" running 10.11.6 "El Capitan" and Safari version 11.1.2, and the problem did not occur. In other words, I could switch between tabs, play sound on both, and it continued to work on both. |
The title of this issue is a little misleading. The problem only occurs if you open a sonified sim in both tabs. Specifically (and these sequences were done on the iPad 2 "Tycho"), if I open RIAW in one tab and then open a 2nd tab and go to Google, then switch back to the original RIAW screen, sound still works fine. I also tested the same scenario but instead of Google I opened a non-sonified PhET sim (acid-base-solutions in this case), and again, sound worked fine upon returning to the RIAW tab. However, when I loaded the currently published version of John Travoltage in the 2nd tab, sound was gone when returning to the RIAW tab. It would seem the using sound in a 2nd tab is what kills it for the first. |
I've added code that resumes the audio context if it is in the "interrupted" state when the sim becomes visible after being made not visible. This seems to improve the situation quite a bit, though I could still make the audio go away on iOS 11 after a lot of switching between tabs. I'm going to call this fixed because I believe it fixes the scenario described in #199 (comment), because lots of tab switching between sound-generating sims is probably a fairly rare use case, because a reload fixes the issue, and because I'm not sure there's much else we could do. |
…-wire#199 (cherry picked from commit 067da32)
Fixed (more or less) in 1.6.0-rc.2, unassigning while we await the results of the RC test. |
I had this happen once in rc.2 though I haven't gotten it to happen again. iOS 12. @jbphet |
I think it's reasonable to close this at this point. |
…audio context state behavior in different browsers, see #58, phetsims/friction#161, phetsims/resistance-in-a-wire#190, phetsims/friction#173, and phetsims/resistance-in-a-wire#199
Device
iPad
OS
iOS 9 and 11 at least
Browser
Safari
Problem Description
For phetsims/qa#219. Found by @jbphet on iOS 9 device.
When two tabs of resistance in a wire are open and one plays sound this disables the other tab's sound. This only occurs if the tabs have been in landscape mode. In portrait this does not occur. I did not reproduce this on Mac OS safari. The published version of John Travoltage did not seem to exhibit this behavior.
Steps to reproduce
The text was updated successfully, but these errors were encountered: