pause btn
This commit is contained in:
@@ -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();
|
||||
});
|
||||
},
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user