Some Code 2
<!DOCTYPE html>
<html>
<body>
<div id="container"></div>
<script>
function youtubeify(url) {
  if(/\.youtube\./.test(url)) {
    url = url.replace('watch?v=', 'embed/');
    url += '?autoplay=1';
  }
  return url;
}
 
var urls = window.location.hash.substr(1).split('&&&');
urls.pop();
var songs = urls.map(function(url) {
  var song = {};
  var parts = url.split('&&');
  song.url = youtubeify(parts[0]);
  var lp = parts[1].split(':');
  song.length = 1000 * (parseInt(lp[0]) * 60 + parseInt(lp[1]));
  return song;
});
 
var currentIndex = 0;
 
function play(song) {
  var template = '<iframe src={src} />';
  document.getElementById('container').innerHTML = template.replace('{src}', song.url);
  ++currentIndex;
  window.setTimeout(play.bind(this, songs[currentIndex]), song.length);
};
 
play(songs[currentIndex]);
</script>
</body>
</html>
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License