-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
79 lines (67 loc) · 2.31 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<title>生日快乐🎂</title>
<script src="https://aframe.io/releases/0.8.0/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://rawgit.com/donmccurdy/aframe-extras/master/dist/aframe-extras.loaders.min.js"></script>
</head>
<body style='margin : 0px; overflow: hidden; debugUIEnabled: false;'>
<div id="videoWrap" style="display: none;">
<video autoplay="autoplay" id="videoBox"></video>
</div>
<!-- <script>
var videoWrap = document.getElementById('videoWrap');
videoWrap.style.width = window.innerWidth + 'px';
videoWrap.style.height = window.innerHeight + 'px';
</script> -->
<!-- <body style='margin : 0px; overflow: hidden;'> -->
<a-scene embedded arjs='sourceType: webcam;'>
<a-marker preset='hiro'>
<a-entity position='5 1 1' text="width: 15; value:Happy birthday, 廖欣LiaoXin"></a-entity>
<a-entity position="0 0 0" gltf-model="src: url(https://czkm.github.io/birthday_cake/res/duck/scene.gltf)">
</a-entity>
</a-marker>
</a-scene>
</body>
</html>
<script>
function getMedia() {
if (navigator.getUserMedia) {
console.log(1)
navigator.getUserMedia({
'video': {
'optional': [{}]
}
}, successFunc, errorFunc);
} else {
alert('Native device media streaming (getUserMedia) not supported in this browser.');
}
}
var localStream;
function successFunc(stream) {
document.getElementById('video').src = window.URL && window.URL.createObjectURL(stream) || stream;
localStream = stream;
}
function errorFunc(e) {
alert('Error!' + e);
}
function closeMedia() {
localStream.stop();
document.getElementById('video').src = '';
}
setTimeout(() => {
// console.log(document.getElementById("arjsDebugUIContainer"))
document.getElementById("arjsDebugUIContainer").className = "hide_style";
})
// }, 10)
// let a = document.getElementById("arjsDebugUIContainer")
// document.getElementById("arjsDebugUIContainer").className = "hide_style";
</script>
<style>
.hide_style {
display: none;
}
</style>