Changeset 271698 in webkit
- Timestamp:
- Jan 21, 2021 10:08:54 AM (18 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 edited
- 1 copied
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/webrtc/concurrentVideoPlayback-expected.txt (modified) (1 diff)
-
LayoutTests/webrtc/concurrentVideoPlayback.html (modified) (1 diff)
-
LayoutTests/webrtc/concurrentVideoPlayback2-expected.txt (added)
-
LayoutTests/webrtc/concurrentVideoPlayback2.html (copied) (copied from trunk/LayoutTests/webrtc/concurrentVideoPlayback.html) (5 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/audio/PlatformMediaSession.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r271696 r271698 1 2021-01-21 Youenn Fablet <youenn@apple.com> 2 3 Allow MediaStream and non MediaStream backed videos to play together 4 https://bugs.webkit.org/show_bug.cgi?id=199661 5 <rdar://problem/68622411> 6 7 Reviewed by Eric Carlson. 8 9 * webrtc/concurrentVideoPlayback-expected.txt: 10 * webrtc/concurrentVideoPlayback.html: 11 * webrtc/concurrentVideoPlayback2-expected.txt: Added. 12 * webrtc/concurrentVideoPlayback2.html: Added. 13 1 14 2021-01-21 Youenn Fablet <youenn@apple.com> 2 15 -
trunk/LayoutTests/webrtc/concurrentVideoPlayback-expected.txt
r267644 r271698 3 3 PASS Basic audio/video exchange 4 4 PASS Play MediaStream backed streams concurrently 5 PASS Play regular video content should pause MediaStream backed video elements 6 PASS Play MediaStream backed video elements should pause regular video content 5 PASS Play regular video content should not pause MediaStream backed video elements 7 6 -
trunk/LayoutTests/webrtc/concurrentVideoPlayback.html
r245712 r271698 52 52 await video3.play(); 53 53 54 let counter = 0;55 while (!video1.paused && ++counter < 20)56 await new Promise(resolve => setTimeout(resolve, 50));57 58 assert_true(video1.paused, "video1 paused");59 assert_true(video2.paused, "video2 paused");60 assert_false(video3.paused, "video3 paused");61 }, "Play regular video content should pause MediaStream backed video elements");62 63 promise_test(async (test) => {64 await video1.play();65 66 assert_true(video3.paused, "video3 paused");67 68 await video2.play();69 70 let counter = 0;71 while (!video3.paused && ++counter < 20)72 await new Promise(resolve => setTimeout(resolve, 50));73 74 54 assert_false(video1.paused, "video1 paused"); 75 55 assert_false(video2.paused, "video2 paused"); 76 assert_ true(video3.paused, "video3 paused");77 }, "Play MediaStream backed video elements should pause regular video content");56 assert_false(video3.paused, "video3 paused"); 57 }, "Play regular video content should not pause MediaStream backed video elements"); 78 58 </script> 79 59 </body> -
trunk/LayoutTests/webrtc/concurrentVideoPlayback2.html
r271697 r271698 3 3 <head> 4 4 <meta charset="utf-8"> 5 <title>Testing concurrent video playing </title>5 <title>Testing concurrent video playing 2</title> 6 6 <script src="../resources/testharness.js"></script> 7 7 <script src="../resources/testharnessreport.js"></script> … … 12 12 <video id="video2" autoplay controls></video> 13 13 <video id="video3" autoplay controls></video> 14 <video id="video4" autoplay controls></video> 14 15 <script src ="routines.js"></script> 15 16 <script> 16 17 promise_test(async (test) => { 17 if (window.testRunner)18 testRunner.setUserMediaPermission(true);19 20 18 localStream = await navigator.mediaDevices.getUserMedia({audio: true, video: true}); 21 19 … … 34 32 video1.srcObject = localStream; 35 33 video2.srcObject = remoteStream; 34 await video1.play(); 35 await video2.play(); 36 36 }, "Basic audio/video exchange"); 37 37 38 38 promise_test(async (test) => { 39 await video1.play();40 await video2.play();41 42 assert_false(video1.paused, "video1 paused");43 assert_false(video2.paused, "video2 paused");44 }, "Play MediaStream backed streams concurrently");45 46 promise_test(async (test) => {47 48 39 if (window.internals) 49 40 internals.setMediaSessionRestrictions('videoaudio', 'ConcurrentPlaybackNotPermitted'); … … 56 47 await new Promise(resolve => setTimeout(resolve, 50)); 57 48 58 assert_ true(video1.paused, "video1 paused");59 assert_ true(video2.paused, "video2 paused");49 assert_false(video1.paused, "video1 paused"); 50 assert_false(video2.paused, "video2 paused"); 60 51 assert_false(video3.paused, "video3 paused"); 61 }, "Play regular video content should pause MediaStream backed video elements");52 }, "Play regular video content should not pause MediaStream backed video elements"); 62 53 63 54 promise_test(async (test) => { 64 await video1.play(); 65 66 assert_true(video3.paused, "video3 paused"); 67 68 await video2.play(); 55 video4.src = findMediaFile('video', '../media/content/audio-tracks'); 56 await video4.play(); 69 57 70 58 let counter = 0; 71 while (!video 3.paused && ++counter < 20)59 while (!video1.paused && ++counter < 20) 72 60 await new Promise(resolve => setTimeout(resolve, 50)); 73 61 … … 75 63 assert_false(video2.paused, "video2 paused"); 76 64 assert_true(video3.paused, "video3 paused"); 77 }, "Play MediaStream backed video elements should pause regular video content"); 65 assert_false(video4.paused, "video4 paused"); 66 }, "Play regular video content should not pause MediaStream backed video elements but should pause not MediaStream backed video elements"); 67 68 promise_test(async (test) => { 69 await video3.play(); 70 71 assert_false(video1.paused, "video1 paused"); 72 assert_false(video2.paused, "video2 paused"); 73 assert_false(video3.paused, "video3 paused"); 74 assert_true(video4.paused, "video4 paused"); 75 }, "Restart regular video content should not pause MediaStream backed video elements but should pause not MediaStream backed video elements"); 76 77 promise_test(async (test) => { 78 await video2.pause(); 79 await video2.play(); 80 81 assert_false(video1.paused, "video1 paused"); 82 assert_false(video2.paused, "video2 paused"); 83 assert_false(video3.paused, "video3 paused"); 84 assert_true(video4.paused, "video4 paused"); 85 }, "Pause/play MediaStream backed video elements should not change regular video content"); 78 86 </script> 79 87 </body> -
trunk/Source/WebCore/ChangeLog
r271696 r271698 1 2021-01-21 Youenn Fablet <youenn@apple.com> 2 3 Allow MediaStream and non MediaStream backed videos to play together 4 https://bugs.webkit.org/show_bug.cgi?id=199661 5 <rdar://problem/68622411> 6 7 Reviewed by Eric Carlson. 8 9 Changing heuristic to always allow MediaStream backed videos to play concurrently with other videos. 10 To not break existing websites, we keep the existing behavior for non MediaStream backed videos. 11 12 Test: webrtc/concurrentVideoPlayback2.html 13 14 * platform/audio/PlatformMediaSession.cpp: 15 (WebCore::PlatformMediaSession::canPlayConcurrently const): 16 1 17 2021-01-21 Youenn Fablet <youenn@apple.com> 2 18 -
trunk/Source/WebCore/platform/audio/PlatformMediaSession.cpp
r271670 r271698 366 366 return false; 367 367 368 return m_client.hasMediaStreamSource() &&otherSession.m_client.hasMediaStreamSource();368 return m_client.hasMediaStreamSource() || otherSession.m_client.hasMediaStreamSource(); 369 369 } 370 370
Note: See TracChangeset
for help on using the changeset viewer.