Closed Bug 1305869 Opened 8 years ago Closed 8 years ago

Media controls flicker on and off when playing a html game or other page that repeatedly uses short sounds

Categories

(Firefox for Android Graveyard :: Audio/Video, defect, P2)

All
Android
defect

Tracking

(fennec52+, firefox52 fixed)

RESOLVED FIXED
Firefox 52
Tracking Status
fennec 52+ ---
firefox52 --- fixed

People

(Reporter: kbrosnan, Assigned: alwu)

References

Details

Attachments

(1 file)

When playing a browser based game such as Browser Quest [1] or running the IE Speed Reading [2] the icon for the media controls flickers in and out of the notification area. Maybe we should have a minimum length 15s? 5s? [1] http://browserquest.mozilla.org/ [2] https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/speedreading/
Blocks: 1290836
Assignee: nobody → alwu
tracking-fennec: ? → 52+
Depends on: 1308119
Priority: -- → P2
Attachment #8798334 - Flags: review?(amarchesini)
Comment on attachment 8798334 [details] Bug 1305869 - don't display media control for very short sound. https://reviewboard.mozilla.org/r/83866/#review87582 I prefer to have this logic into MediaElement instead in the AudioChannel. Why do you think this is the correct solution? ::: dom/audiochannel/AudioChannelService.cpp:1304 (Diff revision 2) > mAgents.RemoveElement(aAgent); > > MOZ_ASSERT(mChannels[channel].mNumberOfAgents > 0); > --mChannels[channel].mNumberOfAgents; > > + if (channel == int32_t(AudioChannel::Notification)) { Also this seems wrong. Why don't we want to notify the channel active for 'Notification' ? ::: dom/html/HTMLMediaElement.cpp:5805 (Diff revision 2) > // too late. In that case (block autoplay in non-visited-tab), we need to > // create a connection before decoding, because we don't want user hearing > // any sound. > + if (Duration() < AUDIO_NOTIFICATION_THRESHOLD) { > + // set the type manually to avoid showing the media control for short sound. > + mAudioChannelAgent->SetAudioChannelType(int32_t(AudioChannel::Notification)); This is an horrible hack :) What about if we have a different setup for Notification in the future?
Attachment #8798334 - Flags: review?(amarchesini) → review-
Attachment #8798334 - Flags: review?(s.kaspari)
Comment on attachment 8798334 [details] Bug 1305869 - don't display media control for very short sound. https://reviewboard.mozilla.org/r/83866/#review88518 ::: mobile/android/chrome/content/browser.js:4381 (Diff revision 3) > + // We don't want to show the media control interface for the short sound > + // which duration is smaller than the threshold. > + let mediaDurationThreshold = 1.0; What unit is 1.0? Is this 1 second? Can you add this to the comment or property name? ::: mobile/android/chrome/content/browser.js:4385 (Diff revision 3) > + let audioElements = this.browser.contentDocument.getElementsByTagName("audio"); > + for each (let audio in audioElements) { > + if (!audio.paused == active && audio.duration > mediaDurationThreshold) { > + return true; > + } > + } > + > + let videoElements = this.browser.contentDocument.getElementsByTagName("video"); > + for each (let video in videoElements) { > + if (!video.paused == active && video.duration > mediaDurationThreshold) { > + return true; > + } > + } Do we always have a duration? Are there streaming formats or whatever where we don't have any? ::: mobile/android/chrome/content/browser.js:4387 (Diff revision 3) > + // which duration is smaller than the threshold. > + let mediaDurationThreshold = 1.0; > + > + let audioElements = this.browser.contentDocument.getElementsByTagName("audio"); > + for each (let audio in audioElements) { > + if (!audio.paused == active && audio.duration > mediaDurationThreshold) { "!audio.paused == active" and "!video.paused == active" where a bit hard to understand. Isn't this the same as audio.paused != active and video.paused != active?
Attachment #8798334 - Flags: review?(s.kaspari) → review+
(In reply to Sebastian Kaspari (:sebastian) from comment #5) > What unit is 1.0? Is this 1 second? Can you add this to the comment or > property name? It's second, and I'll add the description in the comment. > ::: mobile/android/chrome/content/browser.js:4385 > Do we always have a duration? Are there streaming formats or whatever where > we don't have any? Yes, the streaming format's duration is infinite, and we don't need to show media control if we don't have any element. > ::: mobile/android/chrome/content/browser.js:4387 > "!audio.paused == active" and "!video.paused == active" where a bit hard to > understand. Isn't this the same as audio.paused != active and video.paused > != active? OK, I'll modify that.
Pushed by alwu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6f21095b038a don't display media control for very short sound. r=sebastian
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 52
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: