Comments (16)
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.
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.
Do you have audio element with reference defined like this?
<audio ref="player" src="music.mp3"></audio>
Which browser?
from vue-audio-visual.
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.
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.
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.
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
from vue-audio-visual.
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.
looks like you are missing closing parentheses between player and autoplay:
<audio ref="player autoplay="true"
from vue-audio-visual.
heres the actual code
from vue-audio-visual.
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.
I am going to close this ticket. Feel free to re-open if you have updates.
Have a good day
from vue-audio-visual.
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.
@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.
@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.
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)
- Uncaught (in promise) TypeError: hv2 is not a function at Proxy.render (AvBase.js:181:12) HOT 4
- Unable to get assignment after network address HOT 2
- Uncaught SyntaxError: The requested module '/node_modules/.vite/deps/vue.js?v=d2d7e806' does not provide an export named 'default' HOT 6
- MediaStream is not defined HOT 1
- Visualizer not visualizing audio with a url HOT 7
- How can i import vue-audio-visual to my project HOT 2
- Switch the local audio file and play it. Do you need to convert the file to blob? HOT 1
- AVBars Component's audio address, unable to use local audio files dynamically HOT 1
- Error with command: npm run dev HOT 1
- 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
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.