-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visualizer not visualizing audio with a url #124
Comments
It is blocked by CORS policy. I will work on the patch. |
@roseaneesha I have made some improvements in the module to make sure CORS is enabled during fetch. |
👋🏻 Hello @staskobzar, I still have trouble using the component with a spotify url source audio (ex: https://p.scdn.co/mp3-preview/805bbe52bc7f8412e9027579787251375e6b847d?cid=11381bbca5f3479f9462199118c15ad9), having an error |
Hello @clemenceroumy To make your link work with AVLine you would do something like that: <script setup lang="ts">
import { ref } from 'vue'
import { makeLineProps } from '@/composables/useProps'
import { useAVLine } from '@/composables/useAVLine'
const props = defineProps(makeLineProps())
const player = ref(null)
const canvas = ref(null)
const spotifyURL = ref('https://p.scdn.co/mp3-preview/805bbe52bc7f8412e9027579787251375e6b847d?cid=11381bbca5f3479f9462199118c15ad9')
useAVLine(player, canvas, props)
</script>
<template>
<audio ref="player"
crossorigin="anonymous"
:controls="true"
:src="spotifyURL" />
<canvas ref="canvas" />
</template> Note crossorigin value in audio element: Basically, all high level functions use compable function to build plugin. You can check "src/components" folder to see how it works for all the components. |
@staskobzar Oh yeah, that works well ! Sorry for the inconveniance and thank you for your quick reply and work :) |
@staskobzar do you have a patch for v2.5.0 for use with Vue 2? I am also blocked by CORS using a url. Response headers have CORS enabled but the request is set to no-cors. |
The audio plays, but the visualizer doesn't seem to show the waves.
This only happens if the source audio is a url (eg:https://www.soundjay.com/human/sounds/heartbeat-01a.mp3)
Works perfectly if the audio is added as a file in the local system
The text was updated successfully, but these errors were encountered: