jhiesey / videostream

Play html5 video when from a file-like object
MIT License
247 stars 73 forks source link

Uncaught TypeError: Cannot read property 'type' of undefined #5

Closed feross closed 9 years ago

feross commented 9 years ago

Moving this issue from https://github.com/feross/instant.io/issues/46 for @jakefb.

screenshot from 2015-05-26 22 27 52

I dragged a 600 MB mp4 file onto the page

feross commented 9 years ago

@jakefb, can you provide the file in question to @jhiesey via email? Otherwise, we'll have to close this issue for lack of sufficient information to debug.

jakefb commented 9 years ago

I emailed @jhiesey a link to the file a few days ago. Maybe he didn't get it?

jhiesey commented 9 years ago

I looked back through my mail and ended up finding it. I'll take a look soon.

jhiesey commented 9 years ago

@jakefb I figured out what's wrong. That file is slightly malformed according to the spec, and while many players are perfectly happy to play it, mp4box.js chokes and fails.

Unfortunately it might be fairly tricky to fix this elegantly due to the design of mp4box.js. I'll try to think if there's an easier solution to this problem.

@jakefb, as a workaround, you can fix the file so it plays by editing a few bytes with a hex editor. Change the four bytes at offsets 0x17b, 0x1d7, 0xde47, and 0xdea3 from 0x72 (which is the letter 'r' in ascii) to 0x0 and it should work.

jhiesey commented 9 years ago

OK I have a better solution. Fixed by this commit: https://github.com/jhiesey/mp4box.js/commit/414178f55e645039ac97ca1d159f7f8cdaa4c146