Ejemplo n.º 1
0
 button.on("hold", function() {
   console.log("hold");
   console.log( playlist );
   if( released ) {
     released = !released;
     if( !state ) {
       omx.play( playlist );
       state = !state;
     } else {
       omx.stop();
       state = !state;
     }
   }
 });
Ejemplo n.º 2
0
 }], function (answer) {
     if (answer.control === 'pause') {
         omx.pause();
         that.play(targetFile);
     }
     if (answer.control === 'play') {
         omx.play(targetFile, {audioOutput: 'hdmi'});
         that.play(targetFile);
     }
     if (answer.control === 'stop') {
         omx.stop();
         that.finder(path.dirname(targetFile));
     }
 }
Ejemplo n.º 3
0
 }], function (answer) {
     if (answer.control === 'pause') {
         omx.pause();
         that.playAll(targetDir, files, isRepeat);
     }
     if (answer.control === 'play') {
         omx.play(files, {audioOutput: 'hdmi', loop: isRepeat});
         that.playAll(targetDir, files, isRepeat);
     }
     if (answer.control === 'stop') {
         omx.stop();
         that.finder(targetDir);
     }
 });
Ejemplo n.º 4
0
	socketNotificationReceived: function(notification, payload) {
		const self = this;
		this.config = payload;
		if(notification == "VIDEO_DOWNLOAD"){
			this.downloadVideo(self.config.videoUrl,"modules/MMM-Podcast/video.mp4",function(){self.loaded = true;});
		}
		else if (notification == 'VIDEO_CHANGED') {		
			var omx = require('omxdirector');
			this.config = payload;	
			var status = omx.getStatus();
			if(status.playing){
				omx.stop();
			}  
			else if(this.loaded){
				omx.play("modules/MMM-Podcast/video.mp4");
			}
			else{
				setTimeout(function(){this.socketNotificationReceived(notification, payload)},2000);
			}
		}
	},
Ejemplo n.º 5
0
var omx  = require('omxdirector');
var path = require('path');

//var events = require('events');
//var eventEmitter = new events.EventEmitter();

var mp3Folder = path.join(__dirname, 'mp3');

omx.play([path.join(mp3Folder, 'one.mp3'), path.join(mp3Folder, 'two.mp3')], {loop: true});