Coder Social home page Coder Social logo

Comments (16)

staskobzar avatar staskobzar commented on May 25, 2024

Hello,
Thanks for the feedback.
Please, give me your template code of your audio and component elements so that I can reproduce it.

For CORS, please check "cors-anonym" property in documentation.

from vue-audio-visual.

rad027 avatar rad027 commented on May 25, 2024

I used

<audio` ref="player" autoplay="true" preload="auto" :src="stream_url + '/stream'">
<av-line
:line-width="2"
line-color="lime"
ref-link="player"

It will show the error on console log that .load() cant be called because the this.$parent.$refs[this.refLink] is returning as undefined.

from vue-audio-visual.

staskobzar avatar staskobzar commented on May 25, 2024

Do you have audio element with reference defined like this?

<audio ref="player" src="music.mp3"></audio>

Which browser?

from vue-audio-visual.

rad027 avatar rad027 commented on May 25, 2024

I updated my recent comment i had a typo.

Im using google chrome latest version.

And also, the src i am using is a shoutcast v2 stream link.

from vue-audio-visual.

staskobzar avatar staskobzar commented on May 25, 2024

This code works for me in Chrome:

<template>
  <div>
    <audio ref="player" controls autoplay="true" preload="auto" :src="path + '.mp3'" >
    </audio>
    <av-line
      :line-width="2"
      line-color="lime"
      ref-link="player"
      cors-anonym
    ></av-line>
  </div>
</template>

<script>
export default {
  name: 'av-line-demo',
  data () {
    return {
      path: 'file_example_MP3_1MG'
    }
  }
}
</script>
<style scoped>
</style>

from vue-audio-visual.

staskobzar avatar staskobzar commented on May 25, 2024

Also, please note, that prop "cors-anonym" works only with components that generate their audio elements. When you use "refs" it means that audio element is created elsewhere in parent context and setting "crossOrigin" parameter has to be done with external audio element as any other.

from vue-audio-visual.

rad027 avatar rad027 commented on May 25, 2024

What vue js version are you using ?
I tried that cors-anonym before modifying the AvBase.js
but im still getting the same error.

here's my recent code that has an error

component :

<audio ref="player autoplay="true" preload="auto" :src="stream_url + '/stream'">
<av-line
:line-width="2"
line-color="lime"
ref-link="player"
cors-anonym

here's the error :
image

from vue-audio-visual.

staskobzar avatar staskobzar commented on May 25, 2024

vue version 2.6.11. I do not think it really matters.
cors-anonym is useless when using ref audio element.
Do you actually close your audio element?

from vue-audio-visual.

staskobzar avatar staskobzar commented on May 25, 2024

looks like you are missing closing parentheses between player and autoplay:

<audio ref="player autoplay="true"

from vue-audio-visual.

rad027 avatar rad027 commented on May 25, 2024

heres the actual code

image

from vue-audio-visual.

staskobzar avatar staskobzar commented on May 25, 2024

It still works for me. Try to use another (local) mp3 file to see if the problem is which audio source.

from vue-audio-visual.

staskobzar avatar staskobzar commented on May 25, 2024

I am going to close this ticket. Feel free to re-open if you have updates.
Have a good day

from vue-audio-visual.

happyshows avatar happyshows commented on May 25, 2024

This code works for me in Chrome:

<template>
  <div>
    <audio ref="player" controls autoplay="true" preload="auto" :src="path + '.mp3'" >
    </audio>
    <av-line
      :line-width="2"
      line-color="lime"
      ref-link="player"
      cors-anonym
    ></av-line>
  </div>
</template>

<script>
export default {
  name: 'av-line-demo',
  data () {
    return {
      path: 'file_example_MP3_1MG'
    }
  }
}
</script>
<style scoped>
</style>

I replaced the src with a valid url which works in av-bars standalone and still get the client.js?06a0:97 TypeError: Cannot read property 'load' of undefined anyway, using chrome/safari does not matter to me.

from vue-audio-visual.

happyshows avatar happyshows commented on May 25, 2024

@staskobzar any idea why it impacts both of us? and could you rerun the sample code with the latest version and let me know if it still work on your side?

from vue-audio-visual.

staskobzar avatar staskobzar commented on May 25, 2024

@happyshows Can you provide the code that does not work, please?
Also, do you have something in Network tab of the console? is you url is loaded fine?

from vue-audio-visual.

staskobzar avatar staskobzar commented on May 25, 2024

I can reproduce it when the src URL and the site URL are different.
For example audio src is https://1.1.1.1:8080 and the site where plugin runs is https://5.5.5.5:9090
Then I have error in console:

MediaElementAudioSource outputs zeroes due to CORS access restrictions for

If you have the same problem, then try to add to your audio element attribute crossorigin="anonymous".

The server that supplies audio also need to be configured send well-formed Access-Control-Allow-Origin header with audio response.

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.