back
▲ 1 points

The Problem of Continuous Playback

by madprops·11y ago·0 comments·view on hn ↗
If we look at Facebook they have an issue, people sometimes want to listen to a song on a youtube video but they also want to navigate away to other places. Recently Facebook has changed the way youtube videos are shown by making them open in a new tab when clicked. This either due to some youtube policy or because they are trying to fix the problem of continuous playback by having the song played in a different tab.

If we look at Soundcloud they are doing it right by having a song keep playing even after navigating to another place. This is possible because Soundcloud is a one big javascript application instead of different pages. But this is also possible because they use their own player, what about youtube iframes?

I tried tackling this problem on my site http://gsick.com by listening to youtube iframe state changes using their iframe API. By controlling this I was able to first fix another common problem, stopping a video automatically before playing the next one. Here's an example https://www.youtube.com/watch?v=oIc-6ZzKtVc . But my initial idea couldn't be fulfilled, which is having the playing iframe moved to another place while navigating somewhere else. I was thinking on having a little youtube box sticked to the side while navigating away allowing continuous playback but apparently iframes reload when they move inside the DOM and apparently there's no way around it (except having position fixed iframes and changing their position but that was out of the question in my case)

// no comments yet