From d652e0ce79709d684b3a55ee12a8d3a61b834de0 Mon Sep 17 00:00:00 2001 From: margau Date: Thu, 1 Jun 2017 10:50:30 +0200 Subject: [PATCH] Constructor and Process Start --- index.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/index.js b/index.js index e69de29..3918f73 100755 --- a/index.js +++ b/index.js @@ -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; + +