Skip to content

billcheng/omxobj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

omxobj

Object oriented omxplayer wrapper for Raspberry PI. This will allow multiple videos playing at the same time. This wrapper has the ability to track the progress as well.

Installation

npm install omxjob

Create an object

omxobj.create(options);

Available options:

layer
hardwareAudioDecoding
enable3D
refresh
startPosition
win
orientation
alpha
info
audioOut
audioPassThrough

Refer to omxplayer for more information.

Example

var omxPlayer1 = omxobj.create({layer: 1});

Methods

.play(filename)
.stop()
.pause()
.volumeUp()
.volumeDown()

Example

var omxobj = require('omxobj');

var omxOverlay = omxobj.create({layer: 2}),
	omxVideo = omxobj.create({layer: 1});
	
omxOverlay.on('stop', function() {
	console.log("stop");
	omxVideo.stop();
	process.exit();
});

setTimeout(function(){
	omxOverlay.play("video1.mp4");
}, 1000);

omxVideo.on("progress", function(progress) {
	console.log("Progress: %d\%", progress);
});

omxVideo.play("video2.mp4");

About

Object oriented omxplayer wrapper for Raspberry PI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published