-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathar3.html
More file actions
101 lines (89 loc) · 3.21 KB
/
Copy pathar3.html
File metadata and controls
101 lines (89 loc) · 3.21 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
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
96
97
98
99
100
101
<!DOCTYPE html>
<html lang="en">
<head>
<!--
This is the page head - it contains info the browser uses to display the page
You won't see what's in the head in the page
Scroll down to the body element for the page content
-->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="https://glitch.com/favicon.ico" />
<!--
This is an HTML comment
You can write text in a comment and the content won't be visible in the page
-->
<title>AR TEST</title>
<!-- Meta tags for SEO and social sharing -->
<script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@1c2407b26c61958baa93967b5412487cd94b290b/dist/aframe-master.min.js"></script>
<script src="https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar-nft.js"></script>
<script>
window.onload = function() {
AFRAME.registerComponent('videohandler', {
init: function () {
var marker = this.el;
this.vid = document.querySelector("#vid");
marker.addEventListener('markerFound', function () {
this.vid.play();
}.bind(this));
marker.addEventListener('markerLost', function() {
this.vid.pause();
this.vid.currentTime = 0;
}.bind(this));
}
});
};
</script>
<style>
.arjs-loader {
height: 100%;
width: 100%;
position: absolute;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.8);
z-index: 9999;
display: flex;
justify-content: center;
align-items: center;
}
.arjs-loader div {
text-align: center;
font-size: 1.25em;
color: white;
}
</style>
</head>
<body style='margin : 0px; overflow: hidden;'>
<div class="arjs-loader">
<div>Loading, please wait...</div>
</div>
<a-scene
vr-mode-ui="enabled: false;"
renderer='antialias: true; alpha: true; precision: medium;'
embedded arjs='trackingMethod: best; sourceType: webcam; debugUIEnabled: false;'>
<a-assets>
<video src="https://cdn.glitch.global/0297c919-0e98-4870-bf9c-ca25fd81156e/recuerdo.mp4?v=1654570245927"
preload="auto" id="vid" response-type="arraybuffer" loop
crossorigin webkit-playsinline autoplay muted playsinline>
</video>
</a-assets>
<a-nft
videohandler
type='nft'
url='https://arjs-cors-proxy.herokuapp.com/https://raw.githack.com/AR-js-org/AR.js/master/aframe/examples/image-tracking/nft/trex/trex-image/trex'
smooth="true" smoothcount="10" smoothtolerance="0.01" smooththreshold="5"
>
<a-video
src="#vid"
position='0 0 0'
rotation='90 0 180'
width='200'
height='150'
>
</a-video>
</a-nft>
<a-entity camera></a-entity>
</a-scene>
</body>
</html>