stream-your-emotions / loveplaylist.txt
shawarmabytes's picture
Upload loveplaylist.txt
54f9bb1
raw
history blame
1.45 kB
<html>
<body>
<div id="player"></div>
<script>
// 2. This code loads the IFrame Player API code asynchronously.
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
// 3. This function creates an <iframe> (and YouTube player)
// after the API code downloads.
function onYouTubeIframeAPIReady() {
var numPl = Math.floor((Math.random() * 50) + 1);
var player = new YT.Player("player", {
height: '315',
width: '560',
playerVars: {
listType:'playlist',
list:'PLg4oJ1n8qDclAeYPtiyZt4A1My816kIyL',
index: numPl,
autoplay: 1,
},
events: {
'onReady': function (event) {
//event.target.cuePlaylist({list: "PL_MH8gOS_ETiNT1NF8B46JYHZe6fXWfVW"});
//event.target.playVideo();
setTimeout(function() {
event.target.setShuffle({'shufflePlaylist' : true});
}, 1000);
}
}
});
}
</script>
</body>
</html>