staskobzar / vue-audio-visual

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

Audio content received in REST API is not working. #48

Closed hardikzignuts closed 4 years ago

hardikzignuts commented 4 years ago

I am using vue-audio-visual version 2.0.0

If am trying to use audio file stored in local or remote location then it's working properly. like

Local source:

<av-waveform
  :canv-width="600"
  audio-src="/assets/GetAudioContentDownload.wav"
></av-waveform>

Remote source:

<av-waveform
  :canv-width="600"
  audio-src="https://staskobzar.github.io/vue-audio-visual/file_example_MP3_1MG.mp3"
></av-waveform>

But if I try to do same thing with the REST API, 'Forward-Backward' controls are not working. And sometime download options also not showing e.g.

<av-waveform"
  :canv-width="600"
  :audio-src="baseURL+'<API endpoint>?id1='+Id1+'id2='+Id2+'&id3='+Id3+'&id4='+Id4"
></av-waveform>

Will help me to improve the issue?

Thank you in advance!

staskobzar commented 4 years ago

Hello, Your issue is about the formatting attribute not the plugin. From what I see, you are missing "&" before "id2=". I do not know how parameter "" would work here. Also I would recommend to use computed value in "audio-src" instead of trying to build it inside the property.

hardikzignuts commented 4 years ago

First of all thanks for your reply. I have checked with changing the format but still Forward-Backward' controls are not working.

staskobzar commented 4 years ago

The plugin is not providing any API capabilities. As alternative you can use any ajax library (like axios), get response as "blob" type and convert it with URL.createObjectURL. I am not sure it is the problem of the plugin.