partially fix song previews temporarily

This commit is contained in:
Kevin Ngo
2018-09-19 07:27:54 -07:00
parent 929db507e5
commit 78006377ff

View File

@@ -74,9 +74,7 @@ AFRAME.registerComponent('song-preview-system', {
if (this.audioStore[challengeId]) { return; }
const audio = document.createElement('audio');
audio.crossOrigin = 'anonymous';
audio.addEventListener('canplaythrough', () => {
audio.currentTime = previewStartTime;
}, false);
// audio.currentTime = previewStartTime;
audio.volume = 0;
this.audioStore[challengeId] = audio;
@@ -158,13 +156,13 @@ AFRAME.registerComponent('song-preview', {
previewStartTime: {type: 'number'}
},
play: function () {
update: function (oldData) {
if (oldData.challengeId && this.data.challengeId !== oldData.challengeId) {
this.el.sceneEl.components['song-preview-system'].clearSong(oldData.challengeId);
}
this.el.sceneEl.components['song-preview-system'].queuePreloadSong(
this.data.challengeId, this.data.previewStartTime
);
},
remove: function () {
this.el.sceneEl.components['song-preview-system'].clearSong(this.data.challengeId);
}
});