keep preview playing if searching
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
AFRAME.registerComponent('intro-song', {
|
||||
schema: {
|
||||
isPlaying: {default: true}
|
||||
isPlaying: {default: true},
|
||||
isSearching: {default: false}
|
||||
},
|
||||
|
||||
init: function () {
|
||||
@@ -14,6 +15,8 @@ AFRAME.registerComponent('intro-song', {
|
||||
|
||||
if (!this.el.sceneEl.isPlaying) { return; }
|
||||
|
||||
if (!oldData.isSearching && this.data.isSearching) { return; }
|
||||
|
||||
// Play.
|
||||
if (!oldData.isPlaying && this.data.isPlaying) {
|
||||
this.analyserEl.components.audioanalyser.resumeContext();
|
||||
|
||||
@@ -9,6 +9,7 @@ AFRAME.registerComponent('song-preview-system', {
|
||||
schema: {
|
||||
challengeId: {default: ''},
|
||||
debug: {default: false},
|
||||
isSearching: {default: false},
|
||||
isSongLoading: {default: false}, // Continue to play preview song during loading.
|
||||
selectedChallengeId: {type: 'string'}
|
||||
},
|
||||
@@ -37,7 +38,7 @@ AFRAME.registerComponent('song-preview-system', {
|
||||
}
|
||||
|
||||
// Unselect.
|
||||
if (oldData.selectedChallengeId && !data.selectedChallengeId) {
|
||||
if (oldData.selectedChallengeId && !data.selectedChallengeId && !data.isSearching) {
|
||||
this.stopSong();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user