tantaman/strut

local video

Closed this issue · 16 comments

Hi, and thank you for this cool tool.

I'm struggling with videos.
How can I upload my local video in a presentation?
I'm running on a local build strut.

All the best

You could always upload it to YouTube but make it unlisted.

Thank you for your answer.
In this case it is scientific datas that I want to keep control on. So I don't want to download it on a server.

For now I found a way by saving the html from strut and adding embed video in the code.
But it may have a better way to do it?

All the best

@mxardre Well, I think you could open up the Markdown editor and put the embed video there.

I tried this in the markdown but nothing showed up :

@mxardre What if you save it and open the resulting HTML?

mwcz commented

Is absolutePathOfTheVideo a file:// URL perhaps? Or a filesystem path like /home/user/etc?

both of them does not work actually.

mwcz commented

That's why I asked, I wouldn't expect either of those to work. Webpages (Strut, for example) aren't allowed to load files from your local disk for security reasons. What you've got should work just fine if you put the video on a webserver (a local one is fine) and include it with an http URL.

One very (very) quick way to do that would be to use Python's built-in webserver:

cd dir_containing_image_file
python -m SimpleHTTPServer

Then set the embed's src to http://localhost:8000/video_filename.avi. That should work!

Keep in mind this will only work locally. If you share your strut presentation with anyone, the video won't work for them.

mwcz commented

Oh, and since you have Strut running locally, it's possible that you can just copy the video file into the same directory as Strut and reference it under the same domain. I don't remember the specifics of Strut's local development environment though.

Thank you very much for your help.
So I built the server with python in the folder. When I upload the video in strut, it displays
No video with the format or the MIME type has been generated.
And the server crash : "Exception happened during processing of request from ('127.0.0.1', 55297)"

mwcz commented

Hmm... I have no idea why the server crashed. You could always try a different local webserver. I've had good luck with the http-server package in npm. But perhaps more importantly, I noticed that in my version of strut, when I click Video, it says "Supports webm & YouTube." You may be out of luck with an avi. :(

mwcz commented

Doh, my mistake, you're using <embed>, not the Video feature. Sorry about that. Sounds like Python's SimpleHTTPServer failed you. Try it a few more times in case it was a fleeting issue, and if it still doesn't work, another webserver probably will.

thank you very much.
i'm going to check out that and tell you

Ok, finally I just save the html file and edit it.
I did not manage to create local server.
To my opinion this is a big issue for strut.

Thank you all for your help

mwcz commented

I don't think it's a big issue. No web-based presentation framework will be able to load arbitrary files from your hard drive, as that would be unconscionably insecure. If you want a video or any type of file to be available on the web, a web server is necessary.

One possible solution is to embed the video in your presentation, using a Data URI. As a warning, the base64 string generated will be HUGE, possibly larger than your clipboard allows. But if you want to try that, here goes:

  1. go to drop64.com
  2. drag and drop your video file into the black box
  3. wait as the base64 string is generated (it could take a while if your video file is large)
  4. copy and paste the base64 string into the src attribute of your embed element, ie src="data:video/avi;base64,..."

In all likelihood, your video will generate a string so big that this isn't going to work. I only mention it because I've used the same process for embedding other, smaller filetypes into strut presentations.

So I'm not using strut for the rigth purpose...
I was looking for something flexible to replace impress from ooo.

Many thanks anyway!