staskobzar / vue-audio-visual

VueJS audio visualization components
MIT License
717 stars 112 forks source link

Audio-Src Media to URL Instead of Local File? #37

Closed xaiyeon closed 4 years ago

xaiyeon commented 4 years ago

Hi, I hope it's okay to write an informal issue. When I specify, in VueJS, audio like:

:audio-src="currentSong.src"

the play and all shows up, but there's no sound? I can't hear anything when I press play (this sounds dumb).

The mp3 file is a URL to my google bucket (proper ACL, etc. for public read permissions set to all). What ways can I try to get it to work? If I try local path files, it does work.

staskobzar commented 4 years ago

Hello, Are there any errors in console? Also, for waveform, source load is done with axios, so google bucket ACL of your browser is not used. As a work around for that you can write you own function to get audio binary with ACL, create local binary copy with URL.createObjectURL and feed to the component audio-src.

xaiyeon commented 4 years ago

Thank you, it took me a bit to figure it out, I just created a computed and watch property for when the music changes and it triggers a function that uses URL.createObjectURL and then sets that to the audio-src.

staskobzar commented 4 years ago

Glad it helped! Good luck and have a good day