beakerbrowser / beaker

An experimental peer-to-peer Web browser
https://beakerbrowser.com/
MIT License
6.75k stars 544 forks source link

Can't load videos on-demand #1140

Closed dcposch closed 4 years ago

dcposch commented 6 years ago

Operation System: macOS High Sierra Beaker version: v0.8.0-prelease-9

steps to reproduce

works in chrome

https://dcpos.ch/beaker-test/06-bazooka-city.mp4

video should start playing near instantly

broken in beaker

go to dat://dcpos.ch/beaker-test/06-bazooka-city.mp4

the video opens. once you click play, you get a frozen gray screen. the console shows the following error:

screen shot 2018-09-09 at 12 59 02 am

looks like the internal beaker HTTP-to-Dat bridge is returning a 500 error.

note that when i came back much later, once the whole dat was downloaded, the video worked. Beaker can render the mp4 just fine, but there's a problem downloading files incrementally over dat.

investigation

to confirm the video files were valid and part of the dat archive, i ran the following:

dat clone dat://36abda5bff5a816b4e69f45e41c6778ebb3c34e45bc6a5e5758e2f047559884b

the dat download creates the video files quickly. however, the files are not playable (zeros/corrupt data) until they finish downloading.

this may be related to the issue i saw in Beaker.

pfrazee commented 6 years ago

Thanks for reporting. The 500 error is interesting. I'll check into this, thanks.

dcposch commented 6 years ago

@pfrazee is there an easy way to see the main/renderer process logs?

i bet the 500 corresponds to a stacktrace in a different process, and i'd paste it here if i knew where to find it

pfrazee commented 6 years ago

There's a debug log you can check screen shot 2018-09-11 at 11 27 12 am

pfrazee commented 6 years ago

Okay I had to deploy a new internal data format to check into this, because without sparse-file support (which my MacOS version lacks) Beaker would allocate 11GB upon visit 🤣. Okay FIXED THAT, and now I could check my log and see what happens. Here it is:

Error reading file Error: Download was cancelled
    at Feed.undownload (/Users/paulfrazee/my/beaker-core/node_modules/hypercore/index.js:353:30)
    at onend (/Users/paulfrazee/my/beaker-core/node_modules/hyperdrive/index.js:498:24)
    at done (/Users/paulfrazee/my/beaker-core/node_modules/hypercore/index.js:586:5)
    at /Users/paulfrazee/my/beaker-core/node_modules/hypercore/index.js:554:40
    at onroot (/Users/paulfrazee/my/beaker-core/node_modules/hypercore/index.js:600:30)
    at onleftchild (/Users/paulfrazee/my/beaker-core/node_modules/hypercore/index.js:616:7)
    at Request._callback (/Users/paulfrazee/my/beaker-core/node_modules/hypercore/lib/storage.js:166:5)
    at Request.callback (/Users/paulfrazee/my/beaker-core/node_modules/random-access-storage/index.js:161:8)
    at onread (/Users/paulfrazee/my/beaker-core/node_modules/random-access-file/index.js:80:31)
    at FSReqWrap.wrapper [as oncomplete] (fs.js:658:17)

I'll need to check with maf to find out why this might be happening.

pfrazee commented 4 years ago

Video playback is fixed in the upcoming release