aadsm / JavaScript-ID3-Reader

ID3 tags reader in JavaScript (ID3v1, ID3v2 and AAC)

Home Page:http://www.aadsm.net/libraries/id3/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Page is loading forever

marcobiedermann opened this issue · comments

I tried you script to extract some ID3 data out of a mp3 file but it does not work for me.
I run my script on localhost and used your script form the documentation.
When I upload the mp3 file to your demo page it works fine.
Here is my setup of the project:

File Stucture

.
|-- index.html
|-- js
|   |-- id3-minimized.js
|   `-- script.js
`-- song.mp3

index.html

<script src="js/id3-minimized.js"></script>
<script src="js/script.js"></script>

script.js

var file = 'song.mp3';

ID3.loadTags(file, function() {
  var tags = ID3.getAllTags(file);
  console.log(tags.artist + " - " + tags.title + ", " + tags.album);
});

Screenshot form most recent version of Chrome Version 40.0.2214.91 (64-bit) on Mac OS X 10.10.1
id3-loading

Any idea? Thank you very much :)

What do you mean with "I run my script on localhost to prevent XHR Request"?
The library either works with the File API or XHR Requests, to use the File API you need to use it like this: https://github.com/aadsm/JavaScript-ID3-Reader/#file-api

I was not correct with my comment. I used localhost instead of file:///Users/[username]/Documents/.... I also read the documentation on the File API and copied your source code from the demo page but it does not work. the site is constantly loading. Unfortunately I get not output in the console, so I can not give you more information.
My idea was to create a nice looking audio player with the HTML5 audio tag and get the song title, artist and album cover from the ID3 meta tags.