-
Notifications
You must be signed in to change notification settings - Fork 39
Description
Describe the bug
getAudioFromOPFS(currentAudio.id).then((v) => { const audioSource = v || getDownloadLink(currentAudio.download_url, "high"); load(audioSource, { html5: true, autoplay: true, initialMute: false, onend: handleOnEnd, }, }); if ("mediaSession" in navigator) navigator.mediaSession.playbackState = "playing"; });
I have this code for using OPFS to store some audio offline. If the audio is unavailable in OPFS, it will fetch the audio from the source. The issue is that the getAudioFromOPFS function returns a blob URL (eg. blob:http://localhost:3001/1cf18e65-9e51-42f0-818c-6fb851566fad). Initially, the load function doesn't play the music until I click again on the play button, which calls togglePlayPause from useGlobalAudioPlayer hook. And when I change the audio src to remote URL, it works perfectly
To Reproduce
Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior
A clear and concise description of what you expected to happen.
Environment (please complete the following information):
- Browser/ browser version:
- Library version:
- React version:
- Node version: