Commit 616d47c
committed
Safari local video element pauses after bluetooth audioinput is disconnected
https://bugs.webkit.org/show_bug.cgi?id=231787
rdar://problem/84529041
Reviewed by Eric Carlson.
We receive a remote pause command when BT is disconnected.
We also get remote commands from keyboard and the current heuristic does not work well with video conference websites
that have multiple media elements playing at the same time.
We introduce a new heuristic in that case, where instead of pausing/playing media elements, we mute/unmute capture and audio rendering.
This allow users for instance to restart capture/audio using Safari UI.
We update WebPlaybackControlsManager setPlaying to always send an IPC message since calling playing may unmute WebProcess.
Covered by API test.
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::updateIsPlayingMedia):
* Source/WebCore/dom/Document.h:
(WebCore::Document::activeMediaElementsWithMediaStreamCount const):
* Source/WebCore/html/MediaElementSession.cpp:
(WebCore::isDocumentPlayingSeveralMediaStreams):
(WebCore::processRemoteControlCommandIfPlayingMediaStreams):
(WebCore::MediaElementSession::didReceiveRemoteControlCommand):
(WebCore::MediaElementSession::nowPlayingInfo const):
* Source/WebCore/platform/mac/WebPlaybackControlsManager.mm:
(-[WebPlaybackControlsManager setPlaying:]):
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebKit/GetUserMedia.mm:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/webrtc-remote.html: Added.
Canonical link: https://commits.webkit.org/259478@main1 parent 5357882 commit 616d47c
File tree
7 files changed
+203
-7
lines changed- Source/WebCore
- dom
- html
- platform/mac
- Tools/TestWebKitAPI
- TestWebKitAPI.xcodeproj
- Tests
- WebKitCocoa
- WebKit
7 files changed
+203
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4592 | 4592 | | |
4593 | 4593 | | |
4594 | 4594 | | |
| 4595 | + | |
| 4596 | + | |
| 4597 | + | |
| 4598 | + | |
| 4599 | + | |
| 4600 | + | |
4595 | 4601 | | |
4596 | 4602 | | |
4597 | 4603 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1525 | 1525 | | |
1526 | 1526 | | |
1527 | 1527 | | |
| 1528 | + | |
1528 | 1529 | | |
1529 | 1530 | | |
1530 | 1531 | | |
| |||
2265 | 2266 | | |
2266 | 2267 | | |
2267 | 2268 | | |
| 2269 | + | |
2268 | 2270 | | |
2269 | 2271 | | |
2270 | 2272 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1118 | 1118 | | |
1119 | 1119 | | |
1120 | 1120 | | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
1121 | 1163 | | |
1122 | 1164 | | |
1123 | 1165 | | |
1124 | 1166 | | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
1125 | 1171 | | |
1126 | 1172 | | |
1127 | 1173 | | |
| |||
1189 | 1235 | | |
1190 | 1236 | | |
1191 | 1237 | | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
1192 | 1243 | | |
1193 | 1244 | | |
1194 | 1245 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
| 344 | + | |
| 345 | + | |
351 | 346 | | |
352 | 347 | | |
353 | 348 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
1887 | 1888 | | |
1888 | 1889 | | |
1889 | 1890 | | |
| 1891 | + | |
1890 | 1892 | | |
1891 | 1893 | | |
1892 | 1894 | | |
| |||
1943 | 1945 | | |
1944 | 1946 | | |
1945 | 1947 | | |
| 1948 | + | |
1946 | 1949 | | |
1947 | 1950 | | |
1948 | 1951 | | |
| |||
4801 | 4804 | | |
4802 | 4805 | | |
4803 | 4806 | | |
| 4807 | + | |
4804 | 4808 | | |
4805 | 4809 | | |
4806 | 4810 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
1269 | 1270 | | |
1270 | 1271 | | |
1271 | 1272 | | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
1272 | 1350 | | |
1273 | 1351 | | |
1274 | 1352 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
0 commit comments