Video and file upload
It would be nice to have the ability to upload videos and files. You could use the same file manager and just allow those type of files too. For files, maybe we could use the file manager to upload, and then use the link option to insert it as a download option.
@kassemz I ended up going a different route in providing those videos to our users. 'routing' the video through Bookstack doesn't really help when using a distributed file system for large files when it's not providing a direct link to those files. I ended up using Cloudflare stream for video playback and created a separate bucket with a specific policy that allows me to link directly to the video for the user to download.
Hi @Abijeet
I love Bookstack and am trying to leverage it to also provide video instructions for some tasks on a synology system. The video files are going to be stored on the synology system locally.
I wonder if this was solved. I have the same issue described above "TheFiZi". I am able to upload the mp4 but it doesn't play the mp4. (FYI, I had also changed the upload limits etc at the link that @kassemz posted )
Alternatively, if it hasn't been solved, has anyone found a workaround ?
My concern is more on ensuring I can play the videos. The videos are in mp4 format. If the specifics of mp4 have to be changed, I am sure I can use handbreak to change them.
FYI, I installed Bookstack using Portainer ( https://www.youtube.com/watch?v=_13K1DeZwhk ).
thanks
NB
Hi Guys,
I found a work around, It seems to work on safari & chrome on macs so far.
As mentioned above my system is a synology and I have installed bookstack using Portainer link above.
The image files when uploaded to the bookstack website are being accessed through the following URL http://www.myhomenetwork/uploads/images/gallery/2021-06/sample.jpg. The file is being uploaded to the docker folder /docker/bookstack/www/uploads/images/gallery/2021-06/.
So I created another folder (videos) under uploads which was at /docker/bookstack/www/uploads/, once I uploaded the mp4 or m4v files there, they played fine without any challenges (if I accessed them directly.
Now when I needed to inserted a video (insert/edit media) on a editable page, I inserted the full URL http://www.myhomenetwork/uploads/videos/sample.mp4. It worked perfectly.
Hope this helps those of you who are having challenges.
NB
Was wondering if there is any update on native video upload and player support. Most of our wikis are becoming video explainers and would love if the app supports it. We're currently using a workaround with video.js and editing page's html, but its not sustainable.
So I created another folder (videos) under uploads which was at /docker/bookstack/www/uploads/, once I uploaded the mp4 or m4v files there, they played fine without any challenges (if I accessed them directly.
Now when I needed to inserted a video (insert/edit media) on a editable page, I inserted the full URL http://www.myhomenetwork/uploads/videos/sample.mp4. It worked perfectly.
Thanks! Works for me.
@ssddanbrown - Having the ability to set a default location/URL for uploading local video files and then having the ability to select that location (maybe an UPLOAD VIDEO button next to the UPLOAD FILE button) in the Attachments uploader and finally having the option/ability to list the videos in a drop-down list in the Insert/Edit Media popup may be a nice workaround for native browser playback.
So I created another folder (videos) under uploads which was at /docker/bookstack/www/uploads/, once I uploaded the mp4 or m4v files there, they played fine without any challenges (if I accessed them directly.
Now when I needed to inserted a video (insert/edit media) on a editable page, I inserted the full URL http://www.myhomenetwork/uploads/videos/sample.mp4. It worked perfectly.
This works for me too! Notably it solved an issue where scrubbing through the video was broken in Chrome, playback was completely broken in Safari, but everything worked normally in Firefox.
I agree with a lot of the sentiments in this thread though--proper video support in Bookstack is definitely needed! So much documentation is done through short video clips nowadays, so I think even basic and limited support is much better than nothing. Right now, many video uploads at my company will likely have to be done by me personally since getting everyone on my team to learn how to upload the file into the correct folder, etc., will be nigh impossible.
I had the problem with video scrubbing too and I've got a solution:
In App\Http\DownloadResponseFactory.php I extended the method streamedInline with a check on the header "Range" and I add a new response with status code 206 and the header "Content-Range" in order to allow the seeking of the video.
/**
* Create a file download response that provides the file with a content-type
* correct for the file, in a way so the browser can show the content in browser,
* for a given content stream.
*/
public function streamedInline($stream, string $fileName, int $fileSize): StreamedResponse
{
$rangeStream = new RangeSupportedStream($stream, $fileSize, $this->request);
$mime = $rangeStream->sniffMime();
$headers = array_merge($this->getHeaders($fileName, $fileSize, $mime), $rangeStream->getResponseHeaders());
if ($this->request->headers->has('Range')) {
$range = $this->request->header('Range');
preg_match('/bytes=(\d+)-(\d+)?/', $range, $matches);
$start = intval($matches[1]);
$end = isset($matches[2]) ? intval($matches[2]) : ($fileSize - 1);
$headers['Content-Range'] = "bytes {$start}-{$end}/{$fileSize}";
return response()->stream(
fn() => $rangeStream->outputAndClose(),
206,
$headers,
);
}
return response()->stream(
fn() => $rangeStream->outputAndClose(),
$rangeStream->getResponseStatus(),
$headers,
);
}
I hope this solution help you for the next release.
@magunet We already add content-range headers to those responses within this class. Some fixed were made to our logic in v24.10.3, so if using a version before that then make sure you're up-to-date.
@magunet We already add content-range headers to those responses within this class. Some fixed were made to our logic in v24.10.3, so if using a version before that then make sure you're up-to-date.
@ssddanbrown thank you, I still had the v24.10.1 installed. I did the update and it works :)
BookStack is now managed on Codeberg.
As part of this change, we're closing all existing GitHub issues and pull requests. You'll instead find this issue on Codeberg here: https://codeberg.org/bookstack/bookstack/issues/882
Any further discussion for this will now be done on Codeberg. Therefore this GitHub thread will be locked.