Comments (7)
Hello @clemenceroumy
CORS access controll can be set with "" element attribute "crossorigin".
When you use high level interface functions like "AVLine(...)
" this attribute is not enabled. You can use composable function to build and access your "" element.
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.
from vue-audio-visual.
@staskobzar Oh yeah, that works well ! Sorry for the inconveniance and thank you for your quick reply and work :)
from vue-audio-visual.
It is blocked by CORS policy. I will work on the patch.
Thanks for the reports
from vue-audio-visual.
@roseaneesha I have made some improvements in the module to make sure CORS is enabled during fetch.
But the main problem you have is that you source is not returning "Access-Control-Allow-Origin" header, thus restricting access to the source from ajax requests
from vue-audio-visual.
👋🏻 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 MediaElementAudioSource outputs zeroes due to CORS access restrictions for https://p.scdn.co/mp3-preview...
in the console
Is there any way to make this work ?
from vue-audio-visual.
@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.
from vue-audio-visual.
@drewjgray v2 has is
https://github.com/staskobzar/vue-audio-visual/tree/v2#common-props
from vue-audio-visual.
Related Issues (20)
- AVBars bar coloring depending on bars x axis position
- AVWave wrong slider positioning on short audio HOT 7
- AVWave playtime fixed position HOT 2
- waveform overwrites another when 2 wavforms are on screen. HOT 9
- [Vue warn]: Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function. HOT 1
- How to set width of av-line width to 100%? HOT 2
- Hide controls? HOT 2
- Events playing, paused , how to emit them? HOT 2
- Extraneous non-props attributes (ref-link) HOT 1
- When AVWaveform's src uses ref variables, the waveform cannot be displayed normally HOT 5
- Help me!!! Why can firefox display normally but chrome cannot? HOT 6
- For vue 2, after pausing and replaying, the music plays slower in a low key. HOT 9
- Failed to decode audio array buffer: DOMException: Failed to execute 'decodeAudioData' on 'BaseAudioContext': Unable to decode audio data HOT 2
- CDN ? HOT 1
- How do I use audio recorded by MediaRecorder?
- Option for change slider layout from right to left HOT 4
- The slider cannot be clicked after changing source.
- The wave color is not the same that I set HOT 1
- [Vue warn]: Invalid VNode type: Symbol(v-fgt) (symbol) HOT 5
- Tailwindcss support for colors HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-audio-visual.