-
-
Save cycjusz157/704ea39e106d6a89636f to your computer and use it in GitHub Desktop.
#cycoplayer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var list = ''; | |
var x = document.getElementsByTagName('a'); | |
for (var i = 0; i < x.length; i++) { | |
if (x[i].getAttribute('target') != null && x[i].getAttribute('href').indexOf('youtube') != -1) { | |
list = list + ',' + (x[i].getAttribute('href').substring(x[i].getAttribute('href').indexOf('v=') + 2, x[i].getAttribute('href').indexOf('v=') + 13)); | |
} else if (x[i].getAttribute('target') != null && x[i].getAttribute('href').indexOf('youtu.be') != -1) { | |
list = list + ',' + (x[i].getAttribute('href').substring(x[i].getAttribute('href').indexOf('.be') + 4, x[i].getAttribute('href').indexOf('.be') + 15)); | |
} | |
} | |
if (list != null && list != '') { | |
document.getElementsByTagName('html')[0].style.position = 'relative'; | |
document.getElementsByTagName('html')[0].style.minHeight = '100%'; | |
document.getElementsByTagName('body')[0].style.marginBottom = '100px'; | |
var body = document.getElementsByTagName('body')[0].innerHTML; | |
document.getElementsByTagName('body')[0].innerHTML = body + '<footer id="wykotube"></footer>'; | |
var player = document.getElementById('wykotube'); | |
player.style.position = 'fixed'; | |
player.style.bottom = '0'; | |
player.style.right = '0'; | |
player.style.marginRight = '0'; | |
player.style.padding = '5px 5px 5px 5px'; | |
player.style.width = '26.5%'; | |
player.style.height = '30%'; | |
player.style.zIndex = '99'; | |
player.style.backgroundColor = '#3c3c3c'; | |
console.log(list); | |
player.innerHTML = '<div><h4>#CYCOPLAYER</h4></div><div><iframe id="ytplayer" type="text/html" width="100%" height="100%" src="https://www.youtube.com/embed/?playlist=' + list.substring(1, list.length) + '&version=3&autoplay=1" frameborder="0" allowfullscreen></div>'; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment