-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
204 lines (163 loc) · 7.36 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/gh/mmonahan333/ICU/dist/aframe-master.js"></script>
<script src="https://unpkg.com/aframe-ambisonic-component"></script>
<style type="text/css">
.ctrl-btn button {
width:80px;
}
.progress {
width: 100%;
appearance: none;
border-radius: 5px;
height: 5px;
background: #d3d3d3;
outline: none;
}
#video {
display:inline;
}
</style>
<script text="javascript" src="https://cdn.jsdelivr.net/gh/mmonahan333/ICU/js/molmediasync.js"></script>
<script type="module">
import {
TimingObject,
TimingSampler,
TimingProgress
} from "https://webtiming.github.io/timingsrc/lib/timingsrc-esm-v3.js";
// timing object
const to = new TimingObject({range:[0,209]});
//ambisonic test
var ambi = document.getElementById('a1');
console.log(ambi);
// Hook up buttons UI
document.getElementById("reset").onclick = function () {
to.update({position:0});
to.update({velocity:0});
};
document.getElementById("pause").onclick = function () {
to.update({velocity:0});
};
document.getElementById("play").onclick = function () {
to.update({velocity:1});
// ambi.el.components.ambisonic.playSound();
//ambi.entity.setAttribute('sound',play);
ambi.playSound();
};
// refresh position every 100 ms
const sampler = new TimingSampler(to, {period:100});
// position
const pos_elem = document.getElementById("position");
sampler.on("change", function () {
pos_elem.innerHTML = `${to.pos.toFixed(2)}`;
});
// progress
const progress_elem = document.getElementById("progress");
const progress = new TimingProgress(to,
progress_elem, {sampler:sampler});
// Set up video sync
const sync1 = MCorp.mediaSync(document.getElementById('v1'), to);
// Set up video sync
const sync2 = MCorp.mediaSync(document.getElementById('v2'), to);
// Set up video sync
const sync3 = MCorp.mediaSync(document.getElementById('v3'), to);
// Set up video sync
const sync4 = MCorp.mediaSync(document.getElementById('v4'), to);
// Set up video sync
const sync5 = MCorp.mediaSync(document.getElementById('v5'), to);
// Set up video sync
const sync6 = MCorp.mediaSync(document.getElementById('v6'), to);
// Set up video sync
const sync7 = MCorp.mediaSync(document.getElementById('v7'), to);
// Set up video sync
const sync8 = MCorp.mediaSync(document.getElementById('v8'), to);
// Set up video sync
const sync9 = MCorp.mediaSync(document.getElementById('v9'), to);
// Set up video sync
const sync10 = MCorp.mediaSync(document.getElementById('v10'), to);
//Set up audio sync
const sync11 = MCorp.mediaSync(document.getElementById('a1'), to);
window.to = to;
</script>
</head>
<body>
<p>
<div class="ctrl-btn">
<button id="reset">Stop</button>
<button id="play">Play</button>
<button id="pause">Pause</button>
</div>
</p>
<p>
<input type="range" min="0" max="100" value="0" id="progress" class="progress">
</p>
</body>
<style>
#embeddedScene {
width:100%;
height:800px;
}
</style>
<div id="embeddedScene">
<a-scene embedded loading-screen="backgroundColor: black" background="color: black" start>
<a-assets timeout="100">
<video id="v1" autoplay crossOrigin="anonymous">
<source src="https://cdn.jsdelivr.net/gh/mmonahan333/ICU/assets/ICU_1.webm" type="video/webm" />
</video>
<video id="v2" autoplay crossOrigin="anonymous">
<source src="https://cdn.jsdelivr.net/gh/mmonahan333/ICU/assets/ICU_2.webm" type="video/webm" />
</video>
<video id="v3" autoplay crossOrigin="anonymous">
<source src="https://cdn.jsdelivr.net/gh/mmonahan333/ICU/assets/ICU_3.webm" type="video/webm" />
</video>
<video id="v4" autoplay crossOrigin="anonymous">
<source src="https://cdn.jsdelivr.net/gh/mmonahan333/ICU/assets/ICU_4.webm" type="video/webm" />
</video>
<video id="v5" autoplay crossOrigin="anonymous">
<source src="https://cdn.jsdelivr.net/gh/mmonahan333/ICU/assets/ICU_5.webm" type="video/webm" />
</video>
<video id="v6" autoplay crossOrigin="anonymous">
<source src="https://cdn.jsdelivr.net/gh/mmonahan333/ICU/assets/ICU_6.webm" type="video/webm" />
</video>
<video id="v7" autoplay crossOrigin="anonymous">
<source src="https://cdn.jsdelivr.net/gh/mmonahan333/ICU/assets/ICU_7.webm" type="video/webm" />
</video>
<video id="v8" autoplay crossOrigin="anonymous">
<source src="https://cdn.jsdelivr.net/gh/mmonahan333/ICU/assets/ICU_8.webm" type="video/webm" />
</video>
<video id="v9" autoplay crossOrigin="anonymous">
<source src="https://cdn.jsdelivr.net/gh/mmonahan333/ICU/assets/ICU_9.webm" type="video/webm" />
</video>
<video id="v10" autoplay crossOrigin="anonymous">
<source src="https://cdn.jsdelivr.net/gh/mmonahan333/ICU/assets/ICU_10.webm" type="video/webm" />
</video>
<audio id="a1" crossorigin="anonymous" preload="auto" src="https://cdn.jsdelivr.net/gh/mmonahan333/ICU/assets/audio/combined.ogg">
</audio>
</a-assets>
<a-ambisonic
id="ambisonic"
src="#a1"
order="1"
channel-map="FuMa"
></a-ambisonic>
<a-entity material="shader: flat; src: #v1" geometry="primitive: plane; width: 160; height: 90;" position="-160 0 -240" rotation="0 0 0" ></a-entity>
<a-entity material="shader: flat; src: #v2" geometry="primitive: plane; width: 160; height: 90" position="0 0 -240" rotation="0 0 0" ></a-entity>
<a-entity material="shader: flat; src: #v3" geometry="primitive: plane; width: 160; height: 90" position="80 0 -160" rotation="0 -90 0" ></a-entity>
<a-entity material="shader: flat; src: #v4" geometry="primitive: plane; width: 160; height: 90" position="80 0 0" rotation="0 -90 0" ></a-entity>
<a-entity material="shader: flat; src: #v5" geometry="primitive: plane; width: 160; height: 90" position="80 0 160" rotation="0 -90 0" ></a-entity>
<a-entity material="shader: flat; src: #v6" geometry="primitive: plane; width: 160; height: 90" position="0 0 240" rotation="0 -180 0" ></a-entity>
<a-entity material="shader: flat; src: #v7" geometry="primitive: plane; width: 160; height: 90" position="-160 0 240" rotation="0 -180 0" ></a-entity>
<a-entity material="shader: flat; src: #v8" geometry="primitive: plane; width: 160; height: 90" position="-240 0 160" rotation="0 -270 0" ></a-entity>
<a-entity material="shader: flat; src: #v9" geometry="primitive: plane; width: 160; height: 90" position="-240 0 0" rotation="0 -270 0" ></a-entity>
<a-entity material="shader: flat; src: #v10" geometry="primitive: plane; width: 160; height: 90" position="-240 0 -160" rotation="0 -270 0" ></a-entity>
<a-camera
id="camera"
look-controls
wasd-controls
position="0 0 0">
</a-camera>
</a-scene>
</div>
</body>
</html>