Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including omxcontrol with all npm packages installed. Try it out:

var omxcontrol = require("omxcontrol")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

omxcontrol v0.0.1

Nodejs module to control omxplayer. Specifically written for the raspberry pi


Nodejs module to control omxplayer. Specifically written for the raspberry pi


  • omxplayer (installed by default on the raspberry pi raspian image)
  • nodejs (apt-get install nodejs)
  • express (optional)


Basic usage

omx = require('omxcontrol');




Use with express as middleware. This type of usage exposes the above methods as an http api:

omx = require('omxcontrol');


You 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


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free