-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create MediaPlayer and set up MediaPlayerObserver simultaneously
Creating a MediaPlayer will now automatically initialize an initial MediaPlayerObserver instance so that the remote end can receive notifications since the very first moment the player is created. This replaces an earlier workaround made for OnMediaMetadataChanged() specifically. The new browser test CanvasCaptureControlledByMediaSession verifies the desired behavior. Bug: 1191332 Change-Id: I849ef9f9ef10beedb69906f6aeea284f6f7846b5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2781733 Commit-Queue: Wojciech Dzierżanowski <wdzierzanowski@opera.com> Reviewed-by: Tommy Steimel <steimel@chromium.org> Reviewed-by: Thomas Guilbert <tguilbert@chromium.org> Reviewed-by: Robert Sesek <rsesek@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: François Beaufort <beaufort.francois@gmail.com> Cr-Commit-Position: refs/heads/master@{#868035}
- Loading branch information
1 parent
c90b20b
commit 219c411
Showing
10 changed files
with
219 additions
and
179 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
17 changes: 17 additions & 0 deletions
17
content/test/data/media/picture_in_picture/canvas-in-pip.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body /> | ||
|
||
<script> | ||
const video = document.createElement('video'); | ||
|
||
async function start() { | ||
const canvas = document.createElement('canvas'); | ||
canvas.getContext('2d').fillRect(0, 0, canvas.width, canvas.height); | ||
video.srcObject = canvas.captureStream(); | ||
await video.play(); | ||
await video.requestPictureInPicture(); | ||
return true; | ||
} | ||
</script> | ||
</html> |
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
Oops, something went wrong.