forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Keep showing the media notification when paused from the browser
Previously, the media notification is hidden when the user pauses the media in the browser (WebContents), which is inconsistent with pausing from the notification. Now we keep the notification visible when the media is paused from the browser, and only hide it if there is nothing else to play or the user actively hides it. Implementation details: If there are multiple players playing, and user pauses one player in the browser, then we do in the old way: the paused player will be removed from the MediaSesssion. The notification will keep showing. If there is only one player playing, and user pauses it in the browser, then we mark the player as "pending", and don't remove it from the MediaSession. The MediaSession will be in SUSPENDED state. The pending player is only valid when it was the last player in the MediaSession, and the last operation is removing it from MediaSession by a browser pause. Adding players to the MediaSession will invalidate the pending player. When the user requests to resume playing from the notification, if there is a pending player, it will be added to the player set and resume playing. Otherwise, we do in the old way: resume all players in the player set. BUG=539998 Review URL: https://codereview.chromium.org/1525613002 Cr-Commit-Position: refs/heads/master@{#365810}
- Loading branch information
Showing
5 changed files
with
109 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters