Closed Bug 1631087 Opened 4 years ago Closed 4 years ago

Update the timing of propagating media element's audible state

Categories

(Core :: Audio/Video: Playback, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: alwu, Assigned: alwu)

References

Details

Attachments

(1 file)

We woud update media element's audible state to the media controller in the chrome process by NotifyAudibleStateChanged() [1] when element's audible state changes. In addition, we would also propagate that when when media starts [2].

Currently, if media starts inaudibly, we would still propagate an inaudible information to the controller which is actually useless because nothing would happen when we receive inaudible state.

The current audible state in the media controller is actually defect and can't evalute the real audible situation of the controller. In 1627999, I'm planing to have more detailed audible element count by tracking how many media is audible in the contexts, which the media controller controls. Before implementing that, we have to correct the audible state notification we propagate.

  • If media starts inaudibly, then no need to update audible state
  • If audible media paused, send inaudible notification to the controller to make sure it can track all media elements' audible state

[1] https://searchfox.org/mozilla-central/source/dom/html/HTMLMediaElement.cpp#533-537
[2] https://searchfox.org/mozilla-central/rev/aec63591821712236a522f7f55116f582ed7c920/dom/html/HTMLMediaElement.cpp#446

After applying this patch,

  • notify inaudible state only if we already notified audible state before
  • update inaudible state when audible media is paused

Therefore, in the media controller side, it would always see a pair of audible/inaudible notifications like what we do for the pair of ControlledMediaState::ePlayed/ePaused notifications. That can help us implement a way of maintaining a detailed counting about how many media is audible in bug1627999.

Blocks: 1633010
Pushed by alwu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0ec2be54ed82
Update the timing of propagating media element's audible state. r=chunmin
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: