-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
58 lines (50 loc) · 2.03 KB
/
index.html
File metadata and controls
58 lines (50 loc) · 2.03 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PlateaPlayer | Ejemplo</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- Se incluyen los estilos base -->
<link rel="stylesheet" href="css/PlateaPlayer.css">
<style>
#main {
height: 100vh;
width: 100vw;
}
</style>
</head>
<body>
<!-- Contenedor de ejemplo -->
<div id="main"></div>
<!-- Botón para mostrar el funcionamiento de la API -->
<!--<button class="btn btn-danger" id="btnStop">PAUSAR VIDEO</button>-->
<!-- p5.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.0/p5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.0/addons/p5.dom.min.js"></script>
<!-- Para la comunicación con el servidor -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.3/socket.io.js"></script>
<!-- Funcionalidad del player -->
<script src="js/player.js"></script>
<!-- Instanciación de P5.js y PlateaPlayer -->
<script>
var p5 = new p5(PlateaPlayer);
// Opciones de configuración
// "main" hace referencia al id del contendor opcional para el player
var opciones = {
contenedor: "main",
path: "videos/transmision-serial-paralelo.mp4",
pathJSON: "interactions/paralelo-serial.json"
/* pathJSON: "interactions/sense-test.json" */
};
var socket = io.connect("https://platea.localtunnel.me");
var plateaPlayer = new PlateaPlayer(p5, opciones, socket);
// Ejemplo de utilización de la API
/*var btnStop = document.getElementById("btnStop");
btnStop.onclick = function () {
plateaPlayer.pausarVideo();
}*/
</script>
</body>
</html>