aadsm / jsmediatags

Media Tags Reader (ID3, MP4, FLAC)
Other
748 stars 128 forks source link

ID3v2TagReader _parseData() Offset hasn't been loaded yet in Electron env #66

Open ghost opened 7 years ago

ghost commented 7 years ago

ID3v2TagReader _parseData() Offset hasn't been loaded yet

Only appears in Electron.io App, it works perfect in browser. Half of my music that works perfect in browser, doesn't work in Electron env.

It returns this error: {type: "parseData", info: "Offset 1025 hasn't been loaded yet."}

It's ID3v2TagReader _parseData error

ghost commented 7 years ago

And yes! I've your latest update

ghost commented 7 years ago

_parseData > readFrames > _readFrameHeader > case 3 getStringAt > getByteAt > throw new Error("Offset 1025 hasn't been loaded yet.")

Only using XMLHttpRequest method. We can read the same file perfectly using Blob reader.

Check the examples

mp3-examples.zip

ghost commented 7 years ago

I've tried https://www.npmjs.com/package/xhr2 and it returns the same error.

Again, this is just XMLHttpRequest method error. If I convert the file to Blob, and then parse it, it works perfect.

ghost commented 7 years ago

Update: we have converted the files to M4A, and we got an empty tag.tags Object.

Something wrong with XMLHttpRequest method in non-browser envs

ghost commented 7 years ago

Update: we have decided to use Node Buffers to read metadata instead of XMLHttpRequest method.

aadsm commented 7 years ago

I think this might be the same problem as #69, can you check? I've published a new version 3.7.0 with the fix.