Closed Bug 1577367 Opened 5 years ago Closed 5 years ago

MediaController::IsPlaying() can't reflect its playing state correctly

Categories

(Core :: Audio/Video: Playback, task, P2)

task

Tracking

()

RESOLVED DUPLICATE of bug 1571493

People

(Reporter: alwu, Assigned: alwu)

References

Details

Attachments

(5 obsolete files)

If we control media controller by its public methods only, such as Play(), Pause() and Stop(), then media controller's IsPlaying() can reflect the playing state correctly.

However, if we pause controller by Pause(), but resume media from page directly, then the media controller's mIsPlaying won't be modified, so IsPlaying() would return incorrect result.

Depends on: 1602336

Introduce ControlledMediaState to reflect different status of controlled media.

eStarted and eStopped are used for indicating controlled media started and stopped respectively, and eResumed is used when we paused media from media controller before, but resume it from page directly via play(), then we have to update the media controller playing state.

In addition, create a class MediaControlUtils to wrap all those helper functions to show they are used for same module.

Although all controllers we created and added to MediaControlService are all started, but we will support adding non-started controller to MediaControlService in the future, in order to support using MediaSession's metadata.

Therefore, add a new method to check if the controller is started.

Attachment #9114673 - Attachment description: Bug 1577367 - part3 : add new method to check if the controller is started. → Bug 1577367 - part3 : only update media action to content process when we have controlled media.
Attached file Bug 1577367 - part5 : add test. (obsolete) (deleted) —

Controller can control multiple controlled media at the same time, if any of them is playing, then the controller should be playing as well.

Attachment #9114792 - Attachment description: Bug 1577367 - part4 : add test. → Bug 1577367 - part5 : add test.

Comment on attachment 9114673 [details]
Bug 1577367 - part3 : only update media action to content process when we have controlled media.

Revision D56434 was moved to bug 1603878. Setting attachment 9114673 [details] to obsolete.

Attachment #9114673 - Attachment is obsolete: true

This issue will be fixed in bug1571493.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
Attachment #9114670 - Attachment is obsolete: true
Attachment #9114672 - Attachment is obsolete: true
Attachment #9114792 - Attachment is obsolete: true
Attachment #9115018 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: