Closed
Bug 910340
Opened 11 years ago
Closed 10 years ago
When screen is switched off, visibilitychange is not firing when audio is playing
Categories
(Firefox OS Graveyard :: AudioChannel, defect)
Tracking
(blocking-b2g:-)
RESOLVED
WONTFIX
blocking-b2g | - |
People
(Reporter: Harald, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: [games:p1])
Attachments
(2 files)
Expected:
When the phone is switched off, an app should be able to stop all audio playing and resume when it comes visible again.
Actual:
The visibilitychange event when switching off the screen does not fire when audio is playing.
Bug:
When the device screen is switched off, a visibilitychange event should fire. This works only when audio is not playing. Visibilitychange events that get fired when the app goes into the background work as expected.
All games with sound that reacts to visibilitychange to pause/resume are affected. Verified on ZTE Open and Unagi with b2g18 Nightly (20130828041203).
Reporter | ||
Comment 1•11 years ago
|
||
Blocker for a few games without workaround. The app can't know about the screen state and as the audio keeps playing the app is incorrectly blamed.
blocking-b2g: --- → leo?
Comment 2•11 years ago
|
||
Is this bug present on 1.01?
Reporter | ||
Comment 3•11 years ago
|
||
Test case available as website as it does not need to be a packaged app, it is also reproducible in the browser: http://git.io/b910340
Same bug happens on 1.0.1, tested on Unagi.
Comment 4•11 years ago
|
||
Can't block on this then if it reproduces on 1.01. We can slot this in for a future release.
Updated•11 years ago
|
Whiteboard: [games:p1]
Comment 5•11 years ago
|
||
I wanted to add that higher profile games will simply not be willing to ship on the devices as long as this bug hangs around.
Comment 6•11 years ago
|
||
A work around is out best bet, but if there isn't one, then we really need to figure out how to get this into a shipping build asap.
Reporter | ||
Comment 7•11 years ago
|
||
No work-around so far. Onblur fires too late, only after the screen is switched on again and the user interacts with the lockscreen. I will open another bug about this behavior.
Reporter | ||
Comment 9•11 years ago
|
||
(In reply to Preeti Raghunath(:Preeti) from comment #8)
> Can this bug be closed? per Comment 7.
I don't understand. The bug is severe, affects priority partner apps. Comment 7 just clarifies that there is so far *no* workaround. We need this in leo!
Flags: needinfo?(hkirschner)
Comment 10•11 years ago
|
||
I asked if the bug can be closed based on the comment, "I will open another bug about this behavior". If we are retaining this bug we're good.
Flags: needinfo?(hkirschner)
Reporter | ||
Comment 11•11 years ago
|
||
Pardon the confusion. The bug I still need to file is about the aforementioned unpredictable behavior of onblur which would have offered a work-around.
Flags: needinfo?(hkirschner)
Comment 12•11 years ago
|
||
The reason why we have this behaviour is that a partner wants to let the browser to play if it's in foreground and the device is locked.
The browser, as any 'standard' application uses 'normal' as AudioChannelType.
So we wrote an horrible hack that doesn't send the visibility change event when an app is playing audio, it's in foreground and the device is locked.
What you are asking is to remove this hack. Sounds reasonable, but then we break the other feature.
Have you tried to use 'content' as audioChannelType? You need to have the right permissions in the manifest of your app.
Alive, can you give a feedback about this?
Reporter | ||
Comment 13•11 years ago
|
||
We have a workaround! I added mozAudioChannelType to the test case and it works.
If an app wants to continue to play audio when the user switches the device off, isn't that what audio channels are for?
needinfo on :alive to get more feedback on the bug.
Flags: needinfo?(alive)
Comment 14•11 years ago
|
||
Yes, normal channel keeps playing and doesn't get visibilitychange event if it's active + playing right before screen is off. This is intentional.
Flags: needinfo?(alive)
Comment 15•11 years ago
|
||
FYI we're discussing to let normal channel playing at background by default and let the app stops itself when visibility is hidden.
See bug 91123
[Bug 911238] [AudioChannel] Consider to let normal channel play in the background.
Comment 16•11 years ago
|
||
Based on comment 13 a work around is available for 1.1
blocking-b2g: leo? → -
Updated•11 years ago
|
Component: General → AudioChannel
Comment 17•11 years ago
|
||
Hi all, I've attached another test-case that uses the "content" channel but the beg remains. Is the test case bad or does the workaround not work? If the test case is bad, can you upload one that shows the workaround?
Reporter | ||
Comment 18•11 years ago
|
||
(In reply to mbishop from comment #17)
> Hi all, I've attached another test-case that uses the "content" channel but
> the beg remains. Is the test case bad or does the workaround not work? If
> the test case is bad, can you upload one that shows the workaround?
I am still going through emails after being OOO and haven't tested this: The correct HTML attribute should be "mozaudiochannel" [1], not "mozAudioChannelType" (which is the property).
[1]: http://mxr.mozilla.org/mozilla-central/source/content/html/content/test/test_mozaudiochannel.html?force=1#13
Comment 20•11 years ago
|
||
Thank you for putting me in the loop and providing the corrections. With an updated test case (and updating our code), the workaround appears to work. Thank you!
Flags: needinfo?(mbishop)
Updated•11 years ago
|
Blocks: gecko-games
Comment 21•10 years ago
|
||
Continue playing audio is right scenario as mobile phone behavior. I think we don't need to force fixing the visibilityChange bug.
Severity: critical → normal
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
Comment 22•10 years ago
|
||
(In reply to Bobby Chien [:bchien] from comment #21)
> Continue playing audio is right scenario as mobile phone behavior. I think
> we don't need to force fixing the visibilityChange bug.
Correct. This behavior is not going to change, but the visibility state should change.
Currently we have an hack and soon or late we must remove it.
Comment 23•10 years ago
|
||
(In reply to Andrea Marchesini (:baku) from comment #22)
> (In reply to Bobby Chien [:bchien] from comment #21)
> > Continue playing audio is right scenario as mobile phone behavior. I think
> > we don't need to force fixing the visibilityChange bug.
>
> Correct. This behavior is not going to change, but the visibility state
> should change.
> Currently we have an hack and soon or late we must remove it.
agree.
Comment 24•10 years ago
|
||
(In reply to Bobby Chien [:bchien] from comment #23)
> > ... but the visibility state should change. ...
> agree.
Where will this happen? This bug?
You need to log in
before you can comment on or make changes to this bug.
Description
•