-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
95 lines (77 loc) · 3.57 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
83
84
85
86
87
88
89
90
91
92
93
94
95
<!doctype HTML>
<html>
<head>
<!-- SAMPLE https://jsfiddle.net/anil001ry/twfm4ay6/ -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link rel="manifest" href="manifest.json">
<!--<script src="https://aframe.io/releases/0.8.2/aframe.min.js"></script>
<script src="https://cdn.rawgit.com/jeromeetienne/AR.js/1.6.0/aframe/build/aframe-ar.js"></script>-->
<script src="https://aframe.io/releases/0.9.2/aframe.min.js"></script>
<script src="https://cdn.rawgit.com/jeromeetienne/AR.js/1.7.7/aframe/build/aframe-ar.js"></script>
<script src="https://cdn.rawgit.com/donmccurdy/aframe-extras/v4.1.2/dist/aframe-extras.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
AFRAME.registerComponent('vidhandler', {
init: function() {
this.toggle = false;
this.vid = document.querySelector("#vid");
this.vid.pause();
},
tick: function() {
if (this.el.object3D.visible == true) {
// console.log('visible')
if (!this.toggle) {
// console.log('Plaing video...');
this.toggle = true;
this.vid.play();
}
} else {
this.toggle = false;
this.vid.pause();
}
}
});
function refrespage() {
location.reload();
}
function playvid() {
vid.play();
}
</script>
<!-- IF YOU WANT TO PLAY ALPHA VIDEO THEN IT SHOULD BE IN WEBM FORMAT ........
FOR NORMAL VIDEO - MP4 or OGG -->
</head>
<body style="margin : 0px; overflow: hidden;">
<a-scene embedded arjs='sourceType: webcam; debugUIEnabled: false; detectionMode: mono; maxDetectionRate: 60; canvasWidth: 600; canvasHeight: 400; displayWidth:600; displayHeight:400;'>
<a-assets>
<video preload="auto" id="vid" response-type="arraybuffer" loop="false" width="600" height="400" crossorigin webkit-playsinline playsinline controls>
<!--<source src="mov_bbb.mp4">-->
<source src="sample1.mp4">
</video>
</a-assets>
<!--<a-marker id="memarker" type="pattern" preset="pattern" url="pattern-sample1.fw.patt" vidhandler>-->
<!--<a-marker id="memarker" type="pattern" url="pattern-sample1.fw.patt" vidhandler>-->
<a-marker id="memarker" type="pattern" preset="hiro" vidhandler>
<a-plane position='0 0.1 0' rotation="-90 0 0" material='transparent:true;src:#vid' controls></a-plane>
</a-marker>
<!--</a-marker-camera>-->
<a-entity camera></a-entity>
</a-scene>
<!--
<div class="footer">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pull-left">
<div class="onebleft">
<button onclick="vid.playvid()" class="btn btnskips">Play (CHROME)</button>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pull-right">
<div class="onebright">
<button onclick="refrespage()" class="btn btnskips">Refresh</button>
</div>
</div>
</div>
</div>-->
</body>
</html>