New issue
Advanced search Search tips

Issue 906285 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 19
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

Add support for grouped media sessions

Project Member Reported by beccahughes@chromium.org, Nov 16

Issue description

Sessions should be able to have a group. This group will be keyed to the browser or the PWA/Chrome app.

For reference group ids will be allocated as follows:
  - MediaSessionImpl (sessions associated with a WebContents) will have a static const group_id which
    means they will all share the same group id.
  - We will add something to //extensions so that each extension will override the group id of the
    media session. This means that Chrome apps and PWAs will be in different group ids.

All other sessions will have a randomly generated group id.

Rationale doc: https://docs.google.com/document/d/1-n-hiCy35-Czogzn_ItKtRqxJYooWU3Dnwr_m11Ndvo/edit#heading=h.9yjkamdx2qgq
 
Description: Show this description
Labels: M-72
Description: Show this description
Project Member

Comment 4 by bugdroid1@chromium.org, Nov 28

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/39536eb80e22abc1ed15c101acd062712ef72981

commit 39536eb80e22abc1ed15c101acd062712ef72981
Author: Becca Hughes <beccahughes@chromium.org>
Date: Wed Nov 28 01:42:30 2018

[Audio Focus] Request on focus

If we currently have audio focus we should re-request
audio focus when the web contents is focused. This
means with grouping the media session that was
last focused will be pushed to the top of the stack.

BUG= 906285 

Change-Id: I9a7a72897c3c7be1186bdfbc4ef87364f7744a20
Reviewed-on: https://chromium-review.googlesource.com/c/1347614
Commit-Queue: Becca Hughes <beccahughes@chromium.org>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611497}
[modify] https://crrev.com/39536eb80e22abc1ed15c101acd062712ef72981/content/browser/media/session/media_session_impl.cc
[modify] https://crrev.com/39536eb80e22abc1ed15c101acd062712ef72981/content/browser/media/session/media_session_impl.h
[modify] https://crrev.com/39536eb80e22abc1ed15c101acd062712ef72981/content/browser/media/session/media_session_impl_unittest.cc

Project Member

Comment 5 by bugdroid1@chromium.org, Nov 28

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/31479d428fd82fcbdedfa839508ff0196a618f93

commit 31479d428fd82fcbdedfa839508ff0196a618f93
Author: Becca Hughes <beccahughes@chromium.org>
Date: Wed Nov 28 19:01:59 2018

[Audio Focus] Add grouped audio focus

Add grouped audio focus. This means that a media session
can provide an unguessable token when requesting audio
focus. This means that the media session service will
treat all media sessions with the same group id as the
same session when it comes to audio focus.

BUG= 906285 

Change-Id: I184f8de58cfe3cec67db0bb5877f3b352c794f13
Reviewed-on: https://chromium-review.googlesource.com/c/1342939
Commit-Queue: Becca Hughes <beccahughes@chromium.org>
Reviewed-by: Chrome Cunningham <chcunningham@chromium.org>
Reviewed-by: Tommy Steimel <steimel@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611805}
[modify] https://crrev.com/31479d428fd82fcbdedfa839508ff0196a618f93/content/browser/media/session/audio_focus_delegate_default.cc
[modify] https://crrev.com/31479d428fd82fcbdedfa839508ff0196a618f93/content/browser/media/session/audio_focus_delegate_default_browsertest.cc
[modify] https://crrev.com/31479d428fd82fcbdedfa839508ff0196a618f93/content/browser/media/session/media_session_impl.cc
[modify] https://crrev.com/31479d428fd82fcbdedfa839508ff0196a618f93/content/browser/media/session/media_session_impl.h
[modify] https://crrev.com/31479d428fd82fcbdedfa839508ff0196a618f93/services/media_session/audio_focus_manager.cc
[modify] https://crrev.com/31479d428fd82fcbdedfa839508ff0196a618f93/services/media_session/audio_focus_manager.h
[modify] https://crrev.com/31479d428fd82fcbdedfa839508ff0196a618f93/services/media_session/audio_focus_manager_unittest.cc
[modify] https://crrev.com/31479d428fd82fcbdedfa839508ff0196a618f93/services/media_session/public/cpp/test/mock_media_session.cc
[modify] https://crrev.com/31479d428fd82fcbdedfa839508ff0196a618f93/services/media_session/public/cpp/test/mock_media_session.h
[modify] https://crrev.com/31479d428fd82fcbdedfa839508ff0196a618f93/services/media_session/public/mojom/audio_focus.mojom

Project Member

Comment 6 by bugdroid1@chromium.org, Nov 30

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ae7e6672ebe19ab65528fb12db62d4a3d8fdaa80

commit ae7e6672ebe19ab65528fb12db62d4a3d8fdaa80
Author: Becca Hughes <beccahughes@chromium.org>
Date: Fri Nov 30 22:27:45 2018

[Audio Focus] Apps should have separate group

Audio focus is currently grouped for media sessions
in the browser. Apps that are displayed in their
own window (e.g. PWAs, platform apps) should have
their own group id shared across all media sessions
for that app.

BUG= 906285 

Change-Id: I11004301f0e8c3118b62e4b25bcbfe15ecd351e4
Reviewed-on: https://chromium-review.googlesource.com/c/1344821
Commit-Queue: Becca Hughes <beccahughes@chromium.org>
Reviewed-by: Ben Wells <benwells@chromium.org>
Reviewed-by: Luke Halliwell <halliwell@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612820}
[modify] https://crrev.com/ae7e6672ebe19ab65528fb12db62d4a3d8fdaa80/chrome/browser/apps/platform_apps/BUILD.gn
[add] https://crrev.com/ae7e6672ebe19ab65528fb12db62d4a3d8fdaa80/chrome/browser/apps/platform_apps/audio_focus_web_contents_observer.cc
[add] https://crrev.com/ae7e6672ebe19ab65528fb12db62d4a3d8fdaa80/chrome/browser/apps/platform_apps/audio_focus_web_contents_observer.h
[add] https://crrev.com/ae7e6672ebe19ab65528fb12db62d4a3d8fdaa80/chrome/browser/apps/platform_apps/audio_focus_web_contents_observer_browsertest.cc
[modify] https://crrev.com/ae7e6672ebe19ab65528fb12db62d4a3d8fdaa80/chrome/browser/extensions/chrome_extension_host_delegate.cc
[modify] https://crrev.com/ae7e6672ebe19ab65528fb12db62d4a3d8fdaa80/chrome/browser/ui/apps/chrome_app_delegate.cc
[modify] https://crrev.com/ae7e6672ebe19ab65528fb12db62d4a3d8fdaa80/chrome/test/BUILD.gn
[modify] https://crrev.com/ae7e6672ebe19ab65528fb12db62d4a3d8fdaa80/chromecast/browser/cast_media_blocker_unittest.cc
[modify] https://crrev.com/ae7e6672ebe19ab65528fb12db62d4a3d8fdaa80/content/browser/media/session/media_session_impl.h
[modify] https://crrev.com/ae7e6672ebe19ab65528fb12db62d4a3d8fdaa80/content/public/browser/media_session.h

Project Member

Comment 7 by bugdroid1@chromium.org, Dec 19

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6f49429bd2dac73f24935832f5f07bf14f25c81a

commit 6f49429bd2dac73f24935832f5f07bf14f25c81a
Author: Becca Hughes <beccahughes@chromium.org>
Date: Wed Dec 19 10:57:21 2018

[Audio Focus] Web apps should have separate group

Audio focus is currently grouped for media sessions
in the browser. Web apps have their own browser UI and
therefore should have separate audio focus from the
browser. This generates a group id for each web app
shared across all media sessions for that web app.

BUG= 906285 

Change-Id: I7400874e488f571fe62592f0ac65f2cec93cba9f
Reviewed-on: https://chromium-review.googlesource.com/c/1356129
Reviewed-by: Alexey Baskakov <loyso@chromium.org>
Reviewed-by: Ben Wells <benwells@chromium.org>
Commit-Queue: Becca Hughes <beccahughes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#617795}
[modify] https://crrev.com/6f49429bd2dac73f24935832f5f07bf14f25c81a/chrome/browser/extensions/extension_util.cc
[modify] https://crrev.com/6f49429bd2dac73f24935832f5f07bf14f25c81a/chrome/browser/extensions/extension_util.h
[modify] https://crrev.com/6f49429bd2dac73f24935832f5f07bf14f25c81a/chrome/browser/web_applications/components/BUILD.gn
[add] https://crrev.com/6f49429bd2dac73f24935832f5f07bf14f25c81a/chrome/browser/web_applications/components/web_app_audio_focus_id_map.cc
[add] https://crrev.com/6f49429bd2dac73f24935832f5f07bf14f25c81a/chrome/browser/web_applications/components/web_app_audio_focus_id_map.h
[modify] https://crrev.com/6f49429bd2dac73f24935832f5f07bf14f25c81a/chrome/browser/web_applications/components/web_app_tab_helper_base.cc
[modify] https://crrev.com/6f49429bd2dac73f24935832f5f07bf14f25c81a/chrome/browser/web_applications/components/web_app_tab_helper_base.h
[modify] https://crrev.com/6f49429bd2dac73f24935832f5f07bf14f25c81a/chrome/browser/web_applications/extensions/BUILD.gn
[modify] https://crrev.com/6f49429bd2dac73f24935832f5f07bf14f25c81a/chrome/browser/web_applications/extensions/bookmark_app_tab_helper.cc
[modify] https://crrev.com/6f49429bd2dac73f24935832f5f07bf14f25c81a/chrome/browser/web_applications/extensions/bookmark_app_tab_helper.h
[add] https://crrev.com/6f49429bd2dac73f24935832f5f07bf14f25c81a/chrome/browser/web_applications/extensions/web_app_audio_focus_browsertest.cc
[modify] https://crrev.com/6f49429bd2dac73f24935832f5f07bf14f25c81a/chrome/browser/web_applications/web_app_provider.cc
[modify] https://crrev.com/6f49429bd2dac73f24935832f5f07bf14f25c81a/chrome/browser/web_applications/web_app_provider.h
[modify] https://crrev.com/6f49429bd2dac73f24935832f5f07bf14f25c81a/chrome/browser/web_applications/web_app_tab_helper.cc
[modify] https://crrev.com/6f49429bd2dac73f24935832f5f07bf14f25c81a/chrome/browser/web_applications/web_app_tab_helper.h
[add] https://crrev.com/6f49429bd2dac73f24935832f5f07bf14f25c81a/chrome/test/data/extensions/audio_focus_web_app/main.html

Status: Fixed (was: Started)

Sign in to add a comment