4 ms·
The audio demo makes me think of Bandcamp which will pause music that you're playing if another Bandcamp tab starts playing a song separately. Must be a similar
by Minor49er 2y ago
The audio demo makes me think of Bandcamp which will pause music that you're playing if another Bandcamp tab starts playing a song separately. Must be a similar mechanism under the hood
- realPubkey 2y agoThis is likely done with the WebLocks API
- sltkr 2y agoThat doesn't allow signaling another tab, does it?
- 0x457 2y ago> The Web Locks API allows scripts running in one tab or worker to asynchronously acquire a lock, hold it while work is performed, then release it. While held, no other script executing in the same origin can acquire the same lock, *which allows a web app running in multiple tabs or workers to coordinate work and the use of resources.* source: https://developer.mozilla.org/en-US/docs/Web/API/Web_Locks_API https://developer.mozilla.org/en-US/docs/Web/API/Web_Locks_A...
- deleted 2y ago[deleted]
- sltkr 2y agoI read that, but how can that API be used to notify the original tab to stop playing?