Constructor and Process Start

This commit is contained in:
margau 2017-06-01 10:50:30 +02:00
parent 2017bdd9d8
commit d652e0ce79

View File

@ -0,0 +1,32 @@
//Get Child Process
var spawn = require('child_process').spawn;
var VLC_RC = function(options) {
this.options = options || {};
if(!this.options.hasOwnProperty('verbose')) {
this.options.verbose=false;
}
if(!this.options.hasOwnProperty('debug')) {
this.options.debug=false;
}
var args = [
"-I rc", //Remote Control Interface
"--play-and-pause", //Pause at end of Movie
"--fullscreen" //Start in Fullscreen
];
this.vlc_process = spawn('vlc', args);
if(options.verbose) {
console.log("\x1b[37m\x1b[1m","VLC Process created","\x1b[21m");
console.log("Options:");
console.log("\x1b[44m\x1b[37m",this.options,"\x1b[0m");
}
if(options.debug) {
this.vlc_process.stdout.pipe(process.stdout);
this.vlc_process.stderr.pipe(process.stderr);
}
}
VLC_RC.prototype.hello = function() {
//console.log(this.options);
}
module.exports.VLC_RC = VLC_RC;