ready4testing

This commit is contained in:
2015-11-02 15:23:16 +01:00
parent 39ab69f570
commit 2102c30881
8 changed files with 22 additions and 436 deletions
+22 -16
View File
@@ -7,7 +7,7 @@
// load the things we need
var Mplayer = require('node-mplayer');
//nothing yet
var App = null;
@@ -52,31 +52,37 @@ exports.getChannel = function(idx) {
exports.play = function(idx) {
var channel = Conf.channels[idx];
if(channel !== undefined) {
var stream2play;
try {
var stream2play = channel.stream;
/*try {
var parsers = require("playlist-parser");
var M3U = parsers.M3U;
var fs = require("fs");
var playlist = M3U.parse(fs.readFileSync('/Users/gerrit/Downloads/swr3_m.m3u', { encoding: "utf8" }));
Log.inspect('Radio: playlist', playlist);
if(Helper.isDefinedAndNotNull(playlist[0])) {
stream2play = playlist[0].file;
}
} catch(e) {
Log.error(e);
}
if(Helper.isDefinedAndNotNull(stream2play)) {
Log.debug('Radio: Load stream: ' + stream2play);
player.setFile(stream2play);
player.play();
} else {
Log.error('Radio: No stream defined!');
}*/
ls = childProcess.exec(
'mplayer -slave -quiet -input file=' + ,
function (error, stdout, stderr) {
Log.log('Radio: stdout: ' + stdout);
Log.log('Radio: stderr: ' + stderr);
if (error !== null) {
Log.error('Radio: exec error: ' + error);
}
});
ls.on('exit', function (code){
Log.log('Radio: Child process exited with exit code ' + code);
});
}
} else {
Log.error('Radio: No channel defined!');