Bug 259227

Summary: [GTK] Allow automatically pausing the previously playing video with sound when another one starts playing in a newly created tab / window
Product: WebKit Reporter: Jeff Fortin <nekohayo>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Enhancement CC: bugs-noreply, happypig971021, philn
Priority: P2    
Version: WebKit Nightly Build   
Hardware: PC   
OS: Linux   
Bug Depends on:    
Bug Blocks: 245783    

Description Jeff Fortin 2023-07-14 13:40:11 PDT
The "Enhancer for YouTube" webextension add-on¹ has a "Pause videos playing in background tabs when a video starts playing in the foreground tab" setting that makes a lot of sense: if you already have a playing video+audio tab (ex: a YouTube video), if you start another such tab, it automatically pauses playback in the other tab where sound was playing.

I think that's brilliant both for performance, lower power consumption, and for convenience: after all, it is unlikely that you can watch and listen to two videos at the same time _with sound_ ...

The exception I see is WebRTC: you should obviously not stop a WebRTC video+audio stream in favor of some random video from another tab, in that case it makes sense to have both playing at the same time.

---

¹: https://addons.mozilla.org/en-US/firefox/addon/enhancer-for-youtube/ and https://chrome.google.com/webstore/detail/enhancer-for-youtube/ponfpcnoihfmfllpaingbgckeeldkhle
Comment 1 Suhail 2023-07-19 02:29:43 PDT
change from safari to another app which is playing sounds, <audio> status on safari will be paused first and then be playiny, but can't play sounds on safari. This is puzzling.
Comment 2 Philippe Normand 2023-08-03 02:02:58 PDT
(In reply to Suhail from comment #1)
> change from safari to another app which is playing sounds, <audio> status on
> safari will be paused first and then be playiny, but can't play sounds on
> safari. This is puzzling.

This specific bug is not about Safari.
Comment 3 Philippe Normand 2023-08-03 02:04:46 PDT
The problem here is that a different tab means different webview, hence possibly different WebProcess. So this would be a significant effort, and I'm not even sure it would be much GStreamer-related, so I'll update the bug title.