Closed beaufortfrancois closed 4 years ago
Could we use the ResizeObserver API when available in order to avoid polling?
This API is only useful for existing videos. We would still need to poll for new videos sadly
The way I see it, there is only one largest video, if we assume that the main video has to be resized in order for it to not be the main video, wouldn't that resize be caught by the ResizeObserver and at that point, we could run the algorithm to check which video is now the main video?
Your observation is correct. https://github.com/GoogleChromeLabs/picture-in-picture-chrome-extension/pull/42/commits/d250e99a3693f360642e93d2edcecd706570c5b0 addresses it. Let me know what you think.
After PiP window has been created, monitor every second if largest playing video changed so that video conferencing web apps always show the most appropriate video.
@mounirlamouri PTAL