Skip to content

Instantly share code, notes, and snippets.

@nzjames
Last active August 27, 2019 21:58
Show Gist options
  • Save nzjames/6405d7c9b9c1b266611044f014d7ed3a to your computer and use it in GitHub Desktop.
Save nzjames/6405d7c9b9c1b266611044f014d7ed3a to your computer and use it in GitHub Desktop.
javascript:(function(){const x = [...document.querySelectorAll('[itemprop=embedURL]')]; const w = `300px`; const h= `90%`; const v = x.map(i=> { return i.content.split('/').pop(); }).join(','); const src = `https://www.youtube.com/embed/?playlist=${v}`; el = document.querySelector('body > *'); frame = document.createElement('iframe'); frame.frameBorder=0; frame.src=src; frame.style["z-index"]=1; frame.style.right="0px"; frame.style.bottom="0px"; frame.style.position="fixed"; frame.width=w; frame.height=h; el.parentNode.insertBefore(frame, el);})();

Pop Out Punk

A Youtube embed, playlist player creator.

The following code has been run and tested on the DOA forums. https://www.dogsonacid.com/threads/track-of-the-week-20-aug-2019-the-nautical.801995/page-6

TODO

  • Unique the embedURLs
  • Wrap in Bookmarklet
  • Build into a popout window or browser extension
(() => {
const x = [...document.querySelectorAll('[itemprop=embedURL]')];
const w = `300px`;
const h= `90%`;

const v = x.map(i=> {
  return i.content.split('/').pop();
}).join(',');

const src = `https://www.youtube.com/embed/?playlist=${v}`;
el = document.querySelector('body > *');
frame = document.createElement('iframe');
frame.frameBorder=0;
frame.src=src;
frame.style["z-index"]=1;
frame.style.right="0px";
frame.style.bottom="0px";
frame.style.position="fixed";
frame.width=w;
frame.height=h;
el.parentNode.insertBefore(frame, el);
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment