How to access the webdav folder from html (video streaming)

I have set up a webdav folder using this tutorial:

To confuse issues I have multiple sites on the server. I am able to record a live stream to the files webdav folder, located at /var/www/webdav. But I am unable to access it within the HTML using video.js, and with a video js plugin that supports HLS.

My script files are:

<script src="js/video.js"></script>
<script src="js/videojs-http-streaming.min.js"></script>
var player = videojs('vid1');;

My html:

<video-js id=vid1 width=600 height=300 class="vjs-default-skin" controls>

I am getting an error which says:

ERROR: (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED) The media could not be loaded,
either because the server or network failed or because the format is not supported. 

I have tried multiple ways of adding:

Header set Access-Control-Allow-Origin ""

And nothing is working. After many hours of struggling to get a live stream working, I would be extremely grateful for some ideas of what I can do.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi there @calid,

Are you able to access the htttp://IPADRESS/webdav.m3u8 video directly if you visit it via your browser?

If not, what I could suggest is using a subdomain name and creating a new separate virtual host that maps to the /var/www/webdav folder so that then you could use the subdomain name in your JavaScript file.

Let me know how it goes. Regards, Bobby