bneijt / ipfs-video-frontend

The website front-end hosted on ipfs.video
https://ipfs.video
28 stars 8 forks source link

[Question] Is is possible to make it running directly as a webpage on IPFS ? #17

Closed shazz closed 3 years ago

shazz commented 3 years ago

I tried... I built the project and added the dist folder on my ipfs node but when accessing it thru the gfateway, it tries to load some resources like:

http://localhost:8080/index.190f51f3.css
http://localhost:8080/index.1f315489.js

instead of

http://localhost:8080/ipfs/bafybeia4vvmk6w3xdwwqtmnizlc7hntrxfxykotvdkgrom3dpeua7k6rxi/index.190f51f3.css
http://localhost:8080/ipfs/bafybeia4vvmk6w3xdwwqtmnizlc7hntrxfxykotvdkgrom3dpeua7k6rxi/index.1f315489.js

Any easy way to fix that?

Thanks!

bneijt commented 3 years ago

I have not tried it yet, but I think the solution should be in using relative paths for all the resources. Open the index.html and prefix all links with ./.

I don't have time now to try it, so you will have to just have a go by forking the project.

This link might be of use as well https://github.com/parcel-bundler/parcel/issues/206

Let me know hoe you are getting along, I might be able to put in some time myself at a later date.

shazz commented 3 years ago

Thanks for the quick reply! I'll try that!

thanks :)

shazz commented 3 years ago

Quick question, in index.html what is this "https://viewm.moonicorn.network/#%7B%22options%22%3A%7B%22publisherAddr%22%3A%220.." link ? My antivirus doesn't like it at all....

bneijt commented 3 years ago

That is from the iframe containing the ad code from https://www.adex.network/

Search for a mention of iframe and remove it. If your anti-virus is mad about it, maybe consider reporting it to them. They are quite open source and sociable.

shazz commented 3 years ago

ok.. weird my AV says it is spamming and fishing.

Anyway so I cheated a little as the CID is not known before being created so hard to hardcode it so I added the resources then modified the generated index.html just to try.

Result: the webpage loads well but

I tried with:

Are there some limitations on the codecs supported?

bneijt commented 3 years ago

Most definitely, https://ipfs.video/ https://github.com/ipfs/ipfs-docs/pull/814/files

Currently I try to support what the browser supports, which in most cases is VP8/VP9 in WEBM. I wrote code to try to figure out the media codec by searching for magic bytes. Try the examples from the homepage, as they work. If you have something you want to show, consider recoding it. There are example scripts for ffmpeg in the repository and the pull request for ipfs-docs will point to even more methods.

bneijt commented 3 years ago

Please consider posting if your attempt at running this on IPFS was a success or not. For now, I'm considering this question resolved until further notice.