-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support HTTP Byte Serving via Ranges header #93
Comments
This would be awesome! :) If anyone wants to pick this up please let us know and we can try to help! |
I'd like to pick this up. If I run into trouble I'll let you know. Funnily enough, video playback doesn't work at all with staticfile, let alone seeking. Any video just refuses to play, either via firefox or via mpv. The same video works if played with firefox or mpv and if the video is hosted with an apache. I wonder if it's related ? I will try to dig this up and come back with some news. |
I suspect usage of X-Sendfile will fix this too. |
@Cobrand on my end, video playback works fine (in Chrome), it's just seeking that doesn't work. (note if you don't set |
Turns out that I tested with mp4, and it doesn't work in iron at all (probably because it can't seek metadata ?). webm either works without seeking in mpv, or hangs in the middle for long videos (> 30s). So that's definitely our issue here. For info, the difference between Iron and Apache : Iron
Apache
|
So I dug a little bit into how this stuff works, and I have some questions. Basically if you answer with the
First one is dead simple: just send a "File" like we used to do. Second one is less simple but feasible: Answer with the proper Third one is way less simple, you have to answer something like this according to RFC 2046 :
This is technically what we must answer, but unfortunately there is no proper way to answer a multipart body in Iron as of now, so for now I guess I'll pass. I guess there might also be a way to only reply bytes 200 to 1000, but not only this isn't mentioned as allowed or forbidden in the RFCs, but I don't really know what to answer as well. Do we just answer as if only one range was asked, and we just set the For info, Apache will answer this to a
(2208 instead of 2000 is because the delimiter + "Content-type: video/webm" + "Content-range: bytes 3000-4000/29271156" are added as well, twice) Since we can choose to ignore the "Range" header, I guess we can choose to ignore it when we got more than 1 range as well. So yeah if someone knows If I can answer only bytes 1000 to 2000 for a request "Range: bytes=1000-2000, 3000-4000", that'd be great. |
You could just ignore the range request if it's composed of multiple ranges for now. |
This commits adds Partial Content Delivery, as asked in issue iron#93. This enables the "Accept-Ranges" header on all files delivered via static. It is possible to ask only a certain portion of bytes like explicitely described in RFC 7233. Of the 3 ways to ask for a range of bytes (byte x to byte y, everything from byte x to end of file, last y bytes from end of file), every one of them is implemented, but if a request is to ask multi ranges in a same request, this implementation will only account the first range.
Can someone have a look at PR #95 ? |
I'm very excited to see this -- it turns a simple "serve this folder" webserver into something significantly more useful than python's equivalent, especially in the case of e.g. a home media server. |
I totally forgot that I used to have a PR open about that ... I'll try to find some time to get this PR fixed and merged once for all |
Currently, if you have a
<video>
tag whosesrc
is served throughstaticfile
, seeking doesn't work. This can be fixed by supporting Byte Serving.The text was updated successfully, but these errors were encountered: