jhiesey / videostream

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

value out of bounds and slice undefined error (in WebTorrent) #42

Closed mitra42 closed 5 years ago

mitra42 commented 5 years ago

Copied at @jhiesey request from https://github.com/webtorrent/webtorrent/issues/1440

What version of WebTorrent? 0.99.3 What operating system and Node.js version?. OSX - not in node What browser and version? (if using WebTorrent in the browser) Chrome 67.0.3396.99 What did you expect to happen? Download and play What actually happened? Errors ... see below especially the "value" argument is out of bounds and Uncaught TypeError: Cannot read property 'slice' of undefined

The URL is https://dweb.me/arc/archive.org/details/hanabookstory?version=true I also had a report of this page complaining about an invalid hash, but can't repeat that. Note that https://dweb.me/arc/archive.org/details/commute?verbose=true works, so it seems to be specific to WT not handling errors for this specific file.

dweb-transports-bundle.js:147 WebSocket connection to 'wss://tracker.fastcast.nz/' failed: Error in connection establishment: net::ERR_CONNECTION_TIMED_OUT
f @ dweb-transports-bundle.js:147
dweb-transports-bundle.js:147 WebTorrent Torrent WARNING: connection error to wss://tracker.fastcast.nz (hanabookstory)
n.on.e @ dweb-transports-bundle.js:147
r.emit @ dweb-transports-bundle.js:8
(anonymous) @ dweb-transports-bundle.js:147
r.emit @ dweb-transports-bundle.js:8
r._onWarning @ dweb-transports-bundle.js:147
r.emit @ dweb-transports-bundle.js:8
p._onSocketError @ dweb-transports-bundle.js:147
e._onSocketErrorBound @ dweb-transports-bundle.js:147
i @ dweb-transports-bundle.js:8
r.emit @ dweb-transports-bundle.js:8
f._destroy @ dweb-transports-bundle.js:147
f.destroy @ dweb-transports-bundle.js:147
r._ws.onerror @ dweb-transports-bundle.js:147
index.js:1259 Uncaught RangeError: "value" argument is out of bounds
    at checkInt (index.js:1259)
    at Uint8Array.writeUInt32BE (index.js:1369)
    at exports.trun.encode (boxes.js:842)
    at Object.Box._encode (index.js:78)
    at eval (index.js:66)
    at Array.forEach (<anonymous>)
    at Object.Box._encode (index.js:57)
    at eval (index.js:62)
    at Array.forEach (<anonymous>)
    at eval (index.js:61)
checkInt @ index.js:1259
writeUInt32BE @ index.js:1369
exports.trun.encode @ boxes.js:842
Box._encode @ index.js:78
(anonymous) @ index.js:66
Box._encode @ index.js:57
(anonymous) @ index.js:62
(anonymous) @ index.js:61
Box._encode @ index.js:57
Box.encode @ index.js:33
Encoder.box @ encode.js:63
writeFragment @ mp4-remuxer.js:318
(anonymous) @ mp4-remuxer.js:314
MP4Remuxer.seek @ mp4-remuxer.js:294
VideoStream._pump @ videostream.js:78
VideoStream.self._onWaiting @ videostream.js:34
mp4-remuxer.js:321 Uncaught TypeError: Cannot read property 'slice' of undefined
    at eval (mp4-remuxer.js:321)
    at Item.run (browser.js:153)
    at drainQueue (browser.js:123)
(anonymous) @ mp4-remuxer.js:321
Item.run @ browser.js:153
drainQueue @ browser.js:123
setTimeout (async)
runTimeout @ browser.js:41
process.nextTick @ browser.js:143
nextTick @ index.js:26
maybeReadMore @ _stream_readable.js:517
addChunk @ _stream_readable.js:300
readableAddChunk @ _stream_readable.js:278
Readable.push @ _stream_readable.js:245
Encoder.box @ encode.js:64
writeFragment @ mp4-remuxer.js:318
(anonymous) @ mp4-remuxer.js:314
MP4Remuxer.seek @ mp4-remuxer.js:294
VideoStream._pump @ videostream.js:78
VideoStream.self._onWaiting @ videostream.js:34
dweb-transports-bundle.js:147 WebSocket connection to 'wss://tracker.fastcast.nz/' failed: Error in connection establishment: net::ERR_CONNECTION_TIMED_OUT
f @ dweb-transports-bundle.js:147
p._openSocket @ dweb-transports-bundle.js:147
(anonymous) @ dweb-transports-bundle.js:147
dweb-transports-bundle.js:147 WebTorrent Torrent WARNING: connection error to wss://tracker.fastcast.nz (hanabookstory)
n.on.e @ dweb-transports-bundle.js:147
r.emit @ dweb-transports-bundle.js:8
(anonymous) @ dweb-transports-bundle.js:147
r.emit @ dweb-transports-bundle.js:8
r._onWarning @ dweb-transports-bundle.js:147
r.emit @ dweb-transports-bundle.js:8
p._onSocketError @ dweb-transports-bundle.js:147
e._onSocketErrorBound @ dweb-transports-bundle.js:147
i @ dweb-transports-bundle.js:8
r.emit @ dweb-transports-bundle.js:8
f._destroy @ dweb-transports-bundle.js:147
f.destroy @ dweb-transports-bundle.js:147
r._ws.onerror @ dweb-transports-bundle.js:147
error (async)
f @ dweb-transports-bundle.js:147
p._openSocket @ dweb-transports-bundle.js:147
(anonymous) @ dweb-transports-bundle.js:147
setTimeout (async)
p._startReconnectTimer @ dweb-transports-bundle.js:147
p._onSocketError @ dweb-transports-bundle.js:147
e._onSocketErrorBound @ dweb-transports-bundle.js:147
i @ dweb-transports-bundle.js:8
r.emit @ dweb-transports-bundle.js:8
f._destroy @ dweb-transports-bundle.js:147
f.destroy @ dweb-transports-bundle.js:147
r._ws.onerror @ dweb-transports-bundle.js:147
dweb-transports-bundle.js:147 WebSocket connection to 'wss://tracker.fastcast.nz/' failed: Error in connection establishment: net::ERR_CONNECTION_TIMED_OUT
f @ dweb-transports-bundle.js:147
p._openSocket @ dweb-transports-bundle.js:147
(anonymous) @ dweb-transports-bundle.js:147
dweb-transports-bundle.js:147 WebTorrent Torrent WARNING: connection error to wss://tracker.fastcast.nz (hanabookstory)
mitra42 commented 5 years ago

See internetarchive/dweb-archive#43

jhiesey commented 5 years ago

This should be fixed by https://github.com/jhiesey/videostream/commit/6ffef65fe81e32882c457ac4a22827fcbde75961

I'm waiting to release a new version of videostream because I plan to fix some other issues with it tomorrow.

jhiesey commented 5 years ago

Fix published in v2.5.0