Coder Social home page Coder Social logo

Comments (7)

staskobzar avatar staskobzar commented on June 23, 2024 1

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:
image

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.

clemenceroumy avatar clemenceroumy commented on June 23, 2024 1

@staskobzar Oh yeah, that works well ! Sorry for the inconveniance and thank you for your quick reply and work :)

from vue-audio-visual.

staskobzar avatar staskobzar commented on June 23, 2024

It is blocked by CORS policy. I will work on the patch.
Thanks for the reports

from vue-audio-visual.

staskobzar avatar staskobzar commented on June 23, 2024

@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.

clemenceroumy avatar clemenceroumy commented on June 23, 2024

👋🏻 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.

drewjgray avatar drewjgray commented on June 23, 2024

@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.

staskobzar avatar staskobzar commented on June 23, 2024

@drewjgray v2 has is

image

https://github.com/staskobzar/vue-audio-visual/tree/v2#common-props

from vue-audio-visual.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.