andreapaiola / P2P-CDN

WebTorrent CDN with graceful degradation
Other
154 stars 21 forks source link

Can video files stream? #6

Open branze opened 7 years ago

branze commented 7 years ago

Hello, first thank you for making this great thing. I'm testing it but video files can't seems to stream they play only when fully loaded. Is that the way it work or im doing something wrong? And if its not possible yet any chance to make it work? Thank you!!

andreapaiola commented 7 years ago

Yeah, sort of.

Real streaming (with dynamic bandwidth/bitrate) requires a dedicated server and video formats. Apache can send multiple chunks of the file using an HTTP range request (206 Partial Content HTTP response code). Byte serving and client side MediaSourceAPI

An older version of the script can refresh the content of the page everytime a chunk arrive... so it's possible to change the update policy, but I have to decide the API to expose this type of "update policy" and configuration.

Obviously it's a particular case: in general the default behaviour should be good: update after download (think about zip files or other file to download, in general).

Right?

I'd like to talk about it here, so we can decide how to configure the "DOM update policy" here.

Thanks!

andreapaiola commented 7 years ago

And for Safari iOs (recently they add support for WebRTC) there is this bug (?)

https://github.com/DiegoRBaquero/BTorrent/issues/48 https://github.com/webtorrent/webtorrent/issues/1151

andreapaiola commented 7 years ago

See this branch

https://github.com/andreapaiola/P2P-CDN/tree/updatePartial

andreapaiola commented 7 years ago

Example here

https://andreapaiola.name/P2P-CDN/examples/partial.php

branze commented 7 years ago

Still not streaming it wait to full load. Also after sometime this overload and script freeze.

andreapaiola commented 7 years ago

Right it's an experiment, sure it requires more work!

andreapaiola commented 7 years ago

It's a bit tricky... I think that you have to carefully configure the web server... mod_xsendfile for Apache xsendfile for NGinx https://forum.owncloud.org/viewtopic.php?t=29431

I'm not sure, but it's a working hypothesis https://forum.owncloud.org/viewtopic.php?t=29431

https://stackoverflow.com/questions/22632094/mod-xsendfile-firefox-resume-issue

I have to dig further into it... :+1:

jcklpe commented 6 years ago

Nice, I see you use owncloud @andreapaiola Doing NextCloud stuff the last couple of months is exactly what got me looking for a project like this. At least I think this project is what I'm looking for. I also don't know enough backend to really say if what I'm looking for exists etc.