|
Move audio focus control from media/ to content/ and make it per WebContents.
This CL is making each WebContents able to grab its own audio focus from the
system instead of keeping the audio focus for Chromium regardless of the number
of tab producing noise.
This is improving Chromium integration in Android by having each tab behave as
a user would expect an application to behave. For example, it is now possible
to go to a music website, play something then go to Youtube and play a video.
The video will automatically pause the music, the same way the native Youtube
application would pause a music application.
There is a slight "hack" where for sounds known to be short, the audio focus
is requested as TRANSIENT_MAY_DUCK in order to not break running media for
sound effects.
BUG= 486878
Committed: https://crrev.com/3d020b1e04e93bbd318105276a89dd3aa4af1a27
Cr-Commit-Position: refs/heads/master@{#331947}
Total comments: 30
Total comments: 4
Total comments: 2
Total comments: 11
Total comments: 1
Total comments: 33
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+1564 lines, -62 lines) |
Patch |
 |
M |
android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientFullScreenTest.java
|
View
|
1
2
3
4
|
9 chunks |
+10 lines, -10 lines |
0 comments
|
Download
|
 |
M |
android_webview/javatests/src/org/chromium/android_webview/test/MultipleVideosTest.java
|
View
|
1
2
3
4
|
2 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
content/browser/android/browser_jni_registrar.cc
|
View
|
1
2
3
4
5
6
7
8
9
|
2 chunks |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
content/browser/media/android/browser_media_player_manager.h
|
View
|
1
2
3
4
|
3 chunks |
+8 lines, -1 line |
0 comments
|
Download
|
 |
M |
content/browser/media/android/browser_media_player_manager.cc
|
View
|
1
2
3
4
|
7 chunks |
+40 lines, -0 lines |
0 comments
|
Download
|
 |
A |
content/browser/media/android/media_session.h
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+134 lines, -0 lines |
0 comments
|
Download
|
 |
A |
content/browser/media/android/media_session.cc
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+183 lines, -0 lines |
0 comments
|
Download
|
 |
A |
content/browser/media/android/media_session_browsertest.cc
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+544 lines, -0 lines |
0 comments
|
Download
|
 |
A |
content/browser/media/android/media_session_observer.h
|
View
|
1
2
3
4
|
1 chunk |
+24 lines, -0 lines |
0 comments
|
Download
|
 |
M |
content/content_browser.gypi
|
View
|
1
2
3
4
5
6
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
 |
M |
content/content_jni.gypi
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
content/content_tests.gypi
|
View
|
1
2
3
4
5
6
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
A |
content/public/android/java/src/org/chromium/content/browser/MediaSession.java
|
View
|
1
2
3
4
5
6
7
8
9
|
1 chunk |
+88 lines, -0 lines |
0 comments
|
Download
|
 |
M |
content/public/android/java/src/org/chromium/content/common/ContentSwitches.java
|
View
|
1
2
3
4
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
 |
A |
content/public/android/javatests/src/org/chromium/content/browser/MediaSessionTest.java
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+371 lines, -0 lines |
0 comments
|
Download
|
 |
M |
content/public/test/android/javatests/src/org/chromium/content/browser/test/util/DOMUtils.java
|
View
|
1
2
3
4
|
1 chunk |
+47 lines, -10 lines |
0 comments
|
Download
|
 |
A |
content/test/data/android/media/audio-1second.ogg
|
View
|
1
2
3
4
5
6
7
8
9
10
|
Binary file |
0 comments
|
Download
|
 |
A |
content/test/data/android/media/audio-2seconds.ogg
|
View
|
1
2
3
4
5
6
7
8
|
Binary file |
0 comments
|
Download
|
 |
A |
content/test/data/android/media/audio-6seconds.ogg
|
View
|
1
2
3
4
5
6
7
8
|
Binary file |
0 comments
|
Download
|
 |
A |
content/test/data/android/media/media-session.html
|
View
|
1
2
3
4
5
6
7
8
9
10
|
1 chunk |
+27 lines, -0 lines |
0 comments
|
Download
|
 |
A |
content/test/data/android/media/video-1second.mp4
|
View
|
1
2
3
4
5
6
7
8
9
10
|
Binary file |
0 comments
|
Download
|
 |
A |
content/test/data/android/media/video-2seconds.mp4
|
View
|
1
2
3
4
5
6
7
8
|
Binary file |
0 comments
|
Download
|
 |
A + |
content/test/data/android/media/video-6seconds.mp4
|
View
|
1
2
3
4
5
6
7
8
|
Binary file |
0 comments
|
Download
|
 |
M |
media/base/android/java/src/org/chromium/media/MediaPlayerListener.java
|
View
|
|
4 chunks |
+1 line, -30 lines |
0 comments
|
Download
|
 |
M |
media/base/android/media_player_bridge.cc
|
View
|
1
2
3
4
|
1 chunk |
+5 lines, -0 lines |
0 comments
|
Download
|
 |
M |
media/base/android/media_player_listener.cc
|
View
|
|
1 chunk |
+0 lines, -6 lines |
0 comments
|
Download
|
 |
M |
media/base/android/media_player_manager.h
|
View
|
1
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
media/base/android/media_source_player.cc
|
View
|
1
2
3
4
|
1 chunk |
+5 lines, -0 lines |
0 comments
|
Download
|
 |
M |
media/base/android/media_source_player_unittest.cc
|
View
|
1
2
3
4
|
5 chunks |
+56 lines, -1 line |
0 comments
|
Download
|
Total messages: 33 (6 generated)
|