If you have two browser tabs open to a Soundcloud page, or a page with a Soundcloud iFrame, with one tab playing, when you press play in the other tab it will pause the first. Howe exactly is this achieved?
If you have two browser tabs open to a Soundcloud page, or a page with a Soundcloud iFrame, with one tab playing, when you press play in the other tab it will pause the first. Howe exactly is this achieved?
Share Improve this question asked Jan 30, 2014 at 1:08 ZackZack 6777 silver badges17 bronze badges1 Answer
Reset to default 23It uses local storage to achieve this. It stores JSON data of all the songs that have played or been paused in each of your tabs. As soon as you play another song, all of the other songs' playing statuses are set to paused inside local storage. Most likely, a localStorage event is triggered which checks which songs need to be paused and pauses them.