This content originally appeared on Manuel Matuzović - Blog and was authored by Manuel Matuzović
You can use the :picture-in-picture
pseudo-class to style an element, usually a <video>
, which is currently in picture-in-picture mode (PIP).
Clicking the following button puts the video in picture-in-picture mode in supporting browsers (Chrome, Edge, Safari, Opera). Firefox doesn't support the API, but you can right-click the video and select “Watch in Picture-in-Picture“.
When the video is playing in PIP mode, the placeholder for the video switches to the :picture-in-picture
state. Contrary to the information in the support table on MDN, none of the browsers, except for Safari, supports the pseudo-class. At least, according to my tests.
:picture-in-picture {
opacity: 0.3;
filter: blur(5px);
}
Here's how the video placeholder, which by default is not blurred and has a black background color, looks like in Safari.

My blog doesn't support comments yet, but you can reply via blog@matuzo.at.
This content originally appeared on Manuel Matuzović - Blog and was authored by Manuel Matuzović

Manuel Matuzović | Sciencx (2022-10-18T00:00:00+00:00) Day 17: the :picture-in-picture pseudo-class. Retrieved from https://www.scien.cx/2022/10/18/day-17-the-picture-in-picture-pseudo-class-2/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.