How to port .avi files with node.JS files? (File opens download screen instead of streaming)

I am using vid-streamer https://github.com/meloncholy/vid-streamer .

  • To install only create a folder on your computer
  • open a terminal and burn a CD to a folder
  • execute npm init
  • give the application a name like "MyVidStreamer"
  • package.json will be created.
  • npm install express
  • create server.js in the same package.json folder
  • write it and save

    var app = require("express");
    var app = app();
    var vidStreamer = require("vid-streamer");
    app.get("/videos/:type", vidStreamer); //{folder}/{videoName.extension}
    app.listen(3000);
    
  • update vid-streamer configuration: open node_modules / vid-streamer / config / and edit the json file vidStreamer-sample.json:

    {
    "mode": "development",
    "forceDownload": false,
    "random": false,
    "rootFolder": "",   <----
    "rootPath": "",  <-------
    "server": "VidStreamer.js/0.1.4",
    "maxAge": "3600",
    "throttle": false
    }
    
  • create a folder with video names at the same level of our .js server
  • add avi file to it
  • on the make cd terminal follows the path to the folder where we have our server.js
  • node server.js
  • "localhost: 3000/videos/{name_of_your_vid_File.extension}

mp4 ogg, avi . , , , avi

+1
1

, , , , !

, , , , , , (, ;)).

, MP4, WEBM OGG, HTML5 <video>, , , plugin, VLC Web Plugin, QuickTime, Osmozilla - GPAC ,... ( ), ( ).

, " ", , 2 :

  • .
  • , .

, :

, "" ( HTML), , , HTML-, .

, .

+1

Source: https://habr.com/ru/post/1618990/


All Articles