ready4testing
This commit is contained in:
+22
-16
@@ -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!');
|
||||
|
||||
Reference in New Issue
Block a user