0

I'm developing local-only JSP application using Apache Tomcat server. I would like to put a promotion videos on my intro page, but I don't want to move them to webapp folder or anywhere else.

The promotion videos are located:

  • E:\data\videos\2018...

But writing a JSP/HTML like this wont launch the video, but however it works off-server (launching html from desktop for example, so the path may not be issue?)

<video src="file:///E:/data/videos/2018/promotion1.mp4" controls></video>

2 Answers 2

1

Local file links from remote resources are disabled by almost all browsers by default. There are certain possibilities to overcome that, e.g.:

http://kb.mozillazine.org/Links_to_local_pages_do_not_work

https://discourse.mozilla.org/t/opening-links-to-local-files-file/16449/2

To access your static media files from remote page you need to configure your Tomcat server as described here: http://teknosrc.com/access-local-files-static-content-images-videos-media-files-outside-web-application-system-apache-tomcat-server/

Sign up to request clarification or add additional context in comments.

5 Comments

Thanks for answer. I don't think that that's a browser issue, I can play the video off-server when opening html file in browser. As I mentioned in the question, the server is and will stay local only.
This is what I'm saying. Browser will allow you to open local files only off-server when opening html file as file:///. But will not allow to do the same when you open it as http://localhost...
Oh sorry, now I understand it properly. So if there is no way to achieve this, I have to deploy the server to the videos folder I guess. Thank you.
I updated my answer with a link on how to configure tomcat to resolve it. Hope it helps.
Thanks for the link, but unfortunately it does not work.
1

solution: a.) make sure your server is on the same system where the media files are.

b.) If so, you have to create a folder (ex. media) in your application folder inside /src/main/webapp/ and have to put all media files inside a media folder. After that, you can surely access the media files through a server.

1 Comment

Thanks for answer. Unfortunately, that's not the solution I'm looking for. I don't want to move the files anywhere if possible.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.