Search code examples
htmlapacheurlvideowebserver

How to create a direct public link to my videos


I have over 100+ short videos for my project and I need to make direct public links to each of them. I’m not looking to embed videos. I’m looking for links I can make like on the Apache server but a faster process. Similar to this: http://clips.vorwaerts-gmbh.de/VfE_html5.mp4


Solution

  • There are many different server technologies which will allow you serve static content like mp4 files.

    For example node.js supports simple static servers - https://expressjs.com/en/resources/middleware/serve-static.html

    A very simple example form the above link can be as basic as:

    var express = require('express')
    var serveStatic = require('serve-static')
    
    var app = express()
    
    app.use(serveStatic('public/ftp', { 'index': ['default.html', 'default.htm'] }))
    app.listen(3000)
    

    You just need to set the correct directory on your server in the app.use.. line.

    Note this will not support HLS or DASH, which are adaptive bit rate streaming technologies (see here: https://stackoverflow.com/a/42365034/334402). For that you will need a specialised streaming server, but it sounds like your use case is simpler than this.