staskobzar / vue-audio-visual

VueJS audio visualization components
MIT License
723 stars 115 forks source link

How can i import vue-audio-visual to my project #127

Closed loneyao closed 1 year ago

loneyao commented 1 year ago

package.json: "electron": "^13.0.0", "vitest": "^0.28.5", "vue": "^3.2.13", "vue-audio-visual": "^3.0.3", "ant-design-vue": "^3.2.15", "typescript": "~4.1.5" .....

my main.js : import { createApp } from 'vue'; import App from './App.vue'; import 'ant-design-vue/dist/antd.less' import Antd from 'ant-design-vue' import AudioVisual from 'vue-audio-visual' const app = createApp(App) app.use(Antd).use(AudioVisual).mount('#app')

APP.vue: import AVBars from 'vue-audio-visual'

electron + vue3 + typescript

The above is my simple description. The player will not be displayed on the compiled page. I don't know how to set it.

staskobzar commented 1 year ago

you should check console to see if there any errors. Usage example is following:

<AVBars :src="audioSrc" />

The source should be http link. But is seems like you are trying to import the whole file as a binary. Not sure if it works but if you absolutely want to use imported binary file you should probably check URL.createObjectURL() Web API.

loneyao commented 1 year ago

close