Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rikkertkoppes/omxcontrol
nodejs wrapper for omxplayer on the raspberry pi, integrates well with express
https://github.com/rikkertkoppes/omxcontrol
Last synced: 4 months ago
JSON representation
nodejs wrapper for omxplayer on the raspberry pi, integrates well with express
- Host: GitHub
- URL: https://github.com/rikkertkoppes/omxcontrol
- Owner: rikkertkoppes
- Created: 2012-08-17T20:51:28.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2024-04-09T12:42:29.000Z (8 months ago)
- Last Synced: 2024-08-14T15:31:02.450Z (4 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 44
- Watchers: 6
- Forks: 21
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
omxcontrol
==========Nodejs module to control omxplayer. Specifically written for the raspberry pi
Requirements
------------* omxplayer (installed by default on the raspberry pi raspian image)
* nodejs (`apt-get install nodejs`)
* express (optional)Install
-------npm install omxcontrol
Usage
-----Basic usage
omx = require('omxcontrol');omx.start(filename);
omx.pause();
omx.quit();
Use with express as middleware. This type of usage exposes the above methods as an http api:
omx = require('omxcontrol');
express.use(omx());http://localhost/omx/start/:filename
http://localhost/omx/pause
http://localhost/omx/quitYou actually might not want to pass the real file name to the http api, probably to simplify things, but in my case, omxplayer needs a specific url to play youtube video. For this usecase, `omx()` can be passed a mapping function to map the filename to something else. Calling the provided start method is required to actually start the video. Your logic can be async and even choose not to start things:
omx = require('omxcontrol');
express.use(omx(function(fn,start) {
//do something special
start(fn);
}));