control-freak-ide/server/nodejs/testVlc.js
plastic-hub-dev-node-saturn 538369cff7 latest
2021-05-12 18:35:18 +02:00

34 lines
1016 B
JavaScript

"use strict";
const
spawn = require('child_process').spawn,
VLCRenode = require('vlc-renode');
var
options = {
password: 'secret', // defaults to 'admin'
host: '127.0.0.1', // defaults to 'localhost'
port: 8080, // defaults to 8080 anyways
interval: 1000 // defaults to 500
},
process = spawn('vlc', ['-I', 'http', '--http-password', options.password, '--http-port', options.port], {
stdio: 'ignore'
}),
vlc = new VLCRenode(options);
//vlc.play('https://ia802508.us.archive.org/5/items/testmp3testfile/mpthreetest.mp3').then(function(){
vlc.play('/home/mc007/Music/Sasha/HeyNow.mp3').then(function(){
console.log('out');
vlc.adev(100).then(function(what){
console.log('asdf',what);
});
// setTimeout(
// vlc.pause();
});
// nested changes are published in a flattened format: 'change:stats.readbytes'
vlc.on('change:volume', function(oldVal, newVal){
console.log(oldVal);
console.log(newVal);
});