-
Notifications
You must be signed in to change notification settings - Fork 3
/
video.html
37 lines (37 loc) · 1.85 KB
/
video.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
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<title>Twitch Highlight Reel Generator</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons">
<link rel="stylesheet" href="https://unpkg.com/bootstrap-material-design@4.1.1/dist/css/bootstrap-material-design.min.css" integrity="sha384-wXznGJNEXNG1NFsbm0ugrLFMQPWswR3lds2VeinahP8N0zJw9VWSopbjv2x7WCvX" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://unpkg.com/popper.js@1.12.6/dist/umd/popper.js" integrity="sha384-fA23ZRQ3G/J53mElWqVJEGJzU0sTs+SvzG8fXVWP+kJQ1lwFAOkcUOysnlKJC33U" crossorigin="anonymous"></script>
<script src="https://unpkg.com/bootstrap-material-design@4.1.1/dist/js/bootstrap-material-design.js" integrity="sha384-CauSuKpEqAFajSpkdjv3z9t8E7RlpJ1UP0lKM/+NdtSarroVKu069AlsRPKkFBz9" crossorigin="anonymous"></script>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
</head>
<body>
<script src= "https://player.twitch.tv/js/embed/v1.js"></script>
<div id="playa"></div>
<div id="timestamps"></div>
<script type="text/javascript">
var options = {
width: 600,
height: 300,
video: "392794181",
};
var player = new Twitch.Player("playa", options);
var timestamps = [120, 360, 420];
timestamps.forEach(function(time) {
var b = document.createElement("button");
var date = new Date(null);
date.setSeconds(time); // specify value for SECONDS here
var result = date.toISOString().substr(11, 8);
b.innerHTML = result;
b.addEventListener("click", function() {
player.seek(time);
});
document.getElementById("timestamps").appendChild(b);
});
</script>
</body>
</html>