forked from agarwalbharat/AR-using-JS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2.html
72 lines (65 loc) · 2.78 KB
/
2.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
<!doctype HTML>
<html>
<head>
<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">
<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://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) {
if (!this.toggle) {
this.toggle = true;
this.vid.play();
}
} else {
this.toggle = false;
this.vid.pause();
}
}
});
function refrespage() {
location.reload();
}
function playvid() {
vid.play();
}
</script>
</head>
<body style="margin : 0px; overflow: hidden;">
<a-scene embedded artoolkit='sourceType: webcam;trackingMethod: best;debugUIEnabled: false;'>
<a-assets>
<video preload="auto" id="vid" poster="defaultMat_normal.jpg" response-type="arraybuffer" loop="false" crossorigin webkit-playsinline playsinline controls>
<source src="pp.mp4">
<img src="defaultMat_normal.jpg"> Your browser does not support Or Else Please Click Reset Button.
</video>
</a-assets>
<a-marker id="memarker" type="pattern" url="pattern-marker-1.patt" vidhandler>
<a-plane position='0 0.1 0' rotation="-90 0 0" scale="0.5 0.5 0.5" material='transparent:true;src:#vid' controls></a-plane>
</a-marker>
<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>