omxobj

0.1.0 • Public • Published

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('omxPlayer');
 
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");
 

Readme

Keywords

Package Sidebar

Install

npm i omxobj

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • cccheng