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
- 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);
})()