Skip to content
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

Range request support #4758

Merged
merged 5 commits into from Jan 17, 2024
Merged

Range request support #4758

merged 5 commits into from Jan 17, 2024

Conversation

ssddanbrown
Copy link
Member

@ssddanbrown ssddanbrown commented Jan 7, 2024

Ready for merge

Primarily for video support.
This also:

  • Sets content-length so attachment downloads can properly show progress.
  • Adds drag and drop of video into editors to add as an embedded HTML video.

Notes

In testing, all browsers handle video slightly differently.
Worked across Chrome, Firefox and Safari, with each using range headers in some way.
Couldn't get Safari to chunk though. Did an initial byte request, then consumed the rest in one go, even without playing the video, bit strange and leaves the user waiting for download if they scrub.

For cloud (S3) storage, this added functionality is only semi-supported.
Range responses to the browser will work but the full content is fetched to BookStack, then partially streamed.
Means it acts the same browser side, but not great for large video as you'll still be waiting for the full content.
Could benefit in some minor cases though, especially where app hosted close to storage.
Is possible to stream on s3-side, but can't seek, so would need a specific solution to range on that side also lower down in driver. Support for s3 services could vary there. Might also be better to use a signed url base approach depending on support.
For now, this shouldn't have any added downsides, so we'll skip any added s3-specific complexity for now.

Todo

  • Add range header support
  • Add support for head requests
  • Test in a range of browsers
  • Test content at boundaries
    • Test with length just before sniff length
    • Test with length just after sniff length
  • Test with streaming from s3-like storage
  • Cover with testing

Fixed some found issues in the process.
Supports dragging and dropping video attahchments to embed them in the
editor as HTML video tags.
This was the default option anyway, just adding here for
better visibility of this being set.
Can't enable without issues as the app will attempt to seek which does
not work for these streams. Also have not tested on non-s3, s3-like
systems.
@ssddanbrown ssddanbrown merged commit d5a91d0 into development Jan 17, 2024
19 of 21 checks passed
@ssddanbrown ssddanbrown deleted the range_request_support branch January 17, 2024 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

1 participant