Closed zhangruize closed 7 years ago
jsmediatags.read("http://localhost/1.mp3"...
should work, what is the error you're getting?
Here is all error info: XMLHttpRequest cannot load http://localhost/1.mp3. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
This is not JSMediaTags problem. I can read mp3s on 127.0.0.1
@zhangruize if you're getting that error this means you're making a cross domain request which is not allowed unless the server you're connecting to offers a "Access-Control-Allow-Origin" header. Which address is your app running under? Everything needs to match including the port, say if your app is running under "http://localhost:8080/" and you try to access "http://localhost/" then you won't be able to.
I'm closing because this is not an issue with the library itself.
My requirement is try to get the id3 info of local mp3 file which in the same dir of the html page. I know node.js could work, but I need to show these info in html page by js. But these sample code seems didn't work, is there any possible solution on this? Following code all can't work:
jsmediatags.read("1.mp3"...
jsmediatags.read("http://localhost/1.mp3"...