Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: block is undefined @ id3/bufferedbinaryajax.js:215 #24

Closed
veka-server opened this issue Nov 14, 2013 · 4 comments
Closed

TypeError: block is undefined @ id3/bufferedbinaryajax.js:215 #24

veka-server opened this issue Nov 14, 2013 · 4 comments

Comments

@veka-server
Copy link

I found this bug with one on my mp3.

i debug like this :

BEFORE :

this.getByteAt = function(iOffset) {
    var block = getBlockAtOffset(iOffset);
    if( typeof block.data == "string" ) {

AFTER :

this.getByteAt = function(iOffset) {
    var block = getBlockAtOffset(iOffset);
    if(typeof block === "undefined") return 0;
    if( typeof block.data == "string" ) {

it's not perfect but it works. it don't give me an error fatal for my website.

i hope this can help you.

(sorry for my english, i'm french).

@aadsm
Copy link
Owner

aadsm commented Nov 16, 2013

I would need the exact file that is failing to see exactly where it's failing. Do not post files that you don't have the rights to post please :)

@aadsm
Copy link
Owner

aadsm commented Dec 29, 2013

Anton found a bunch of off-by-one issues that I still need to incorporate. He had the same problem as you so I believe that those fixes will solve this issue too.
This is being tracked here: #26

Due to current work demands I haven't been able to work as much as before on this library, but it isn't stopped/forgotten :-)

@aadsm aadsm closed this as completed Dec 29, 2013
@Artlu
Copy link

Artlu commented Jan 10, 2015

I also had this issue. If you're loading the file from a different URL, you need to add the following response headers:
Access-Control-Allow-Origin:
Access-Control-Allow-Headers: If-Modified-Since,Range
Access-Control-Expose-Headers: Accept-Ranges,Content-Encoding,Content-Length,Content-Range

The last header (Access-Control-Expose-Headers) fixed the error "TypeError: block is undefined @ id3/bufferedbinaryajax.js:215"

@aadsm
Copy link
Owner

aadsm commented Jan 12, 2015

Of course, I completely forgot about this in CORS.
Thank you very much, I've added a section to the README explaining this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants