Skip to content

Add files to playlist

Rafostar edited this page Apr 2, 2020 · 2 revisions

You can add files to playlist at any time during streaming. Remember that they have to be of the same media type as set during sending selection. Otherwise extension will not know how to handle them correctly.

const http = require('http');

const postData = [
  "/path/to/first_video.mp4",
  "/path/to/second_video.mp4"
];

const options = {
  host: '127.0.0.1',
  port: 4000,
  path: '/api/playlist?append=true',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  }
};

var req = http.request(options);
req.write(JSON.stringify(postData));
req.end();
Clone this wiki locally