-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
82 lines (64 loc) · 2.19 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>DEATH GRIPS IS ONLINE</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Rock+Salt&display=swap" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<script src="https://unpkg.com/zdog@1/dist/zdog.dist.min.js"></script>
</head>
<body class="texture-1">
<h1>death grips is online!!!</h1>
<!--https://developers.google.com/youtube/iframe_api_reference-->
<div id="player"></div>
<div id="controls">
<button id="btn-pause">Pause</button>
<button id="btn-play">Play</button>
</div>
<canvas class="zdog-canvas" width="800" height="800"></canvas>
<script>
// loads the iframe player api
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
// creates an <iframe> once the api code downloads.
var player;
function onYouTubeIframeAPIReady() {
player = new YT.Player('player', {
height: '0',
width: '0',
videoId: 'vl3L8TxaTU0',
events: {
'onReady': onPlayerReady,
'onStateChange': onPlayerStateChange
}
});
}
// call this function when the video player is ready.
function onPlayerReady(event) {
event.target.playVideo();
}
// when video ends, restart it
function onPlayerStateChange(event) {
if (event.data == YT.PlayerState.ENDED) {
player.seekTo(0, false);
}
}
function pauseVideo() {
player.pauseVideo();
}
function playVideo() {
player.playVideo();
}
var pause = document.querySelector("#btn-pause");
var play = document.querySelector("#btn-play");
pause.addEventListener("click", pauseVideo, false);
play.addEventListener("click", playVideo, false);
</script>
<script src="js/zdog.js"></script>
<script src="js/script.js"></script>
</body>
</html>