-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloader.js
More file actions
25 lines (23 loc) · 748 Bytes
/
Copy pathloader.js
File metadata and controls
25 lines (23 loc) · 748 Bytes
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
document.addEventListener('DOMContentLoaded', function () {
var video = document.querySelector('#video');
var sceneEl = document.getElementById('scene');
let arSystem;
sceneEl.addEventListener('loaded', function () {
arSystem = sceneEl.systems['mindar-image-system'];
});
sceneEl.addEventListener('arReady', function () {
setInterval(function () {
playVideo();
}, 1000 / 30);
});
sceneEl.addEventListener('touchstart', function () {
playVideo();
});
window.addEventListener('click', function () {
//Fix the problem of video not play (A-frame)
playVideo();
});
function playVideo() {
video.play();
}
});