pause btn

This commit is contained in:
Kevin Ngo
2018-07-22 23:58:29 +02:00
parent 98c57f7b24
commit a3a11e9207
6 changed files with 32 additions and 18 deletions

View File

@@ -2,6 +2,10 @@
* Pivot the scene when user enters VR to face the links.
*/
AFRAME.registerComponent('recenter', {
schema: {
enabled: {default: true}
},
init: function() {
var sceneEl = this.el.sceneEl;
this.matrix = new THREE.Matrix4();
@@ -18,9 +22,11 @@ AFRAME.registerComponent('recenter', {
});
// User can also recenter the menu manually.
sceneEl.addEventListener('menudown', () => {
if (!this.data.enabled) { return; }
this.recenter();
});
sceneEl.addEventListener('thumbstickdown', () => {
if (!this.data.enabled) { return; }
this.recenter();
});
},

View File

@@ -47,7 +47,7 @@ AFRAME.registerComponent('song-preview-system', {
this.audioStore[challengeId] = audio;
if (this.preloadQueue.length === 0) {
preloadMetatata(audio);
this.preloadMetadata(audio);
} else {
this.preloadQueue.push(audio);
}
@@ -56,7 +56,7 @@ AFRAME.registerComponent('song-preview-system', {
preloadMetadata: function (audio) {
audio.addEventListener('loadedmetadata', () => {
if (this.preloadQueue.length) {
preloadMetadata(this.preloadQueue[0]);
this.preloadMetadata(this.preloadQueue[0]);
}
});
audio.preload = 'metadata';