aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/music-player.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/music-player.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/music-player.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/music-player.js b/packages/meshbay-hub/src/meshbay_hub/static/music-player.js
index e8124fa..154d761 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/music-player.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/music-player.js
@@ -459,6 +459,9 @@ function MusicPlayerBar({ getConnection, queue, onClose, userPrefs, onSaveQueue
prefetchNext(pos);
} catch (err) {
if (loadTokenRef.current !== myToken) return;
+ // Autoplay refused (no recent tap): the track is loaded and fine, it
+ // waits for the play button. Not an error, and no reason to skip it.
+ if (err && err.name === 'NotAllowedError') { setPlaying(false); prefetchNext(pos); return; }
setError(err.message || String(err));
setPlaying(false);
// `fetchTrackBlob` throws `err_transport` when no node answered for
@@ -524,7 +527,7 @@ function MusicPlayerBar({ getConnection, queue, onClose, userPrefs, onSaveQueue
const audio = audioRef.current;
if (!audio) return;
if (playing) { audio.pause(); setPlaying(false); }
- else { audio.play().then(() => setPlaying(true)).catch(() => {}); }
+ else { audio.play().then(() => { setError(''); setPlaying(true); }).catch(() => {}); }
}, [playing]);
// Reshuffling keeps the currently playing track in place — turning shuffle