Spaces:
Runtime error
Runtime error
shawarmabytes
commited on
Commit
•
54f9bb1
1
Parent(s):
2dab06f
Upload loveplaylist.txt
Browse files- loveplaylist.txt +38 -0
loveplaylist.txt
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html>
|
2 |
+
<body>
|
3 |
+
<div id="player"></div>
|
4 |
+
<script>
|
5 |
+
// 2. This code loads the IFrame Player API code asynchronously.
|
6 |
+
var tag = document.createElement('script');
|
7 |
+
|
8 |
+
tag.src = "https://www.youtube.com/iframe_api";
|
9 |
+
var firstScriptTag = document.getElementsByTagName('script')[0];
|
10 |
+
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
|
11 |
+
|
12 |
+
// 3. This function creates an <iframe> (and YouTube player)
|
13 |
+
// after the API code downloads.
|
14 |
+
function onYouTubeIframeAPIReady() {
|
15 |
+
var numPl = Math.floor((Math.random() * 50) + 1);
|
16 |
+
var player = new YT.Player("player", {
|
17 |
+
height: '315',
|
18 |
+
width: '560',
|
19 |
+
playerVars: {
|
20 |
+
listType:'playlist',
|
21 |
+
list:'PLg4oJ1n8qDclAeYPtiyZt4A1My816kIyL',
|
22 |
+
index: numPl,
|
23 |
+
autoplay: 1,
|
24 |
+
},
|
25 |
+
events: {
|
26 |
+
'onReady': function (event) {
|
27 |
+
//event.target.cuePlaylist({list: "PL_MH8gOS_ETiNT1NF8B46JYHZe6fXWfVW"});
|
28 |
+
//event.target.playVideo();
|
29 |
+
setTimeout(function() {
|
30 |
+
event.target.setShuffle({'shufflePlaylist' : true});
|
31 |
+
}, 1000);
|
32 |
+
}
|
33 |
+
}
|
34 |
+
});
|
35 |
+
}
|
36 |
+
</script>
|
37 |
+
</body>
|
38 |
+
</html>
|