0

I need advice for the following problem: I have a video stored on the local device, let's say in /home/user/video.mp4 And I want to play this video with a html5 video tag on a website I get from a webserver. I tried it with <video src="/home/user/video.mp4" type="video/mp4"></video> with no success. It came to me, that the server will try to resolve the src attribute on the server, where no video.mp4 is present.

So I tried wrapping it in a HTML file, storing it on the client and loading this file in an iframe like this: <iframe src="file:///home/user/wrappedVideo.html"></iframe> It is still not loading the video.

So do you have any advice how to solve this problem? The idea behind is to save bandwith by dropping the video to the client once instead of every request. The amount of clients is limited, as they are all under my control.

Update: Saw a similar question Play local (hard-drive) video file with HTML5 video tag? but that's not exactly what I want to achieve. I can not click on a button to load a local file because the client will be some kind of kiosk / display where no interaction is possible.

Also I would like to avoid using a local webserver to eliminate a possible error source.

Community
  • 1
  • 1
DBX12
  • 2,041
  • 1
  • 15
  • 25
  • So you have a server under your control and you want this video that's on a *local* device to download to a client? That doesn't make any sense. You want to upload to an server then have downloaded to a client kiosk? – zer00ne Nov 28 '16 at 11:06
  • No, not exactly, the video is already on the clients storage. The server would just say "Play that video in this video tag" – DBX12 Nov 28 '16 at 11:10
  • Oh you mean server access to local drive? Sounds like a security issue, if you have the client storing the video, you should create a single webpage with the tag. You really don't need an external or local server. You cut the middle man out of the equation. – zer00ne Nov 28 '16 at 11:13
  • I'm not sure we understand each other. The client has the video and requests the website, server delivers website and the client renders the website with pictures and the client will include the video from its own local storage. The server will never touch the video, he just sends the "order" to play the video. – DBX12 Nov 28 '16 at 11:39
  • This may help: https://stackoverflow.com/questions/22029731/problems-with-todataurl-html5-other-ways-to-get-canvas-data/22029788#22029788. A server is recommended though as it sandboxes the scope of the file system (you can consider using soft/hard links to existing video files, or copy them all to a virtual folder). If someone is able to tamper the link in your page they can possibly load any file of your system with the file:// approach... –  Nov 29 '16 at 09:02
  • At the current state, it is impossible to tamper with the site, as the displaying system has no input devices in normal operation and the hardware is inaccessible. – DBX12 Nov 29 '16 at 12:31

0 Answers0