Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@ffrm/node-omxplayer
Advanced tools
Readme
A library for controlling the Raspberry Pi omxplayer from Node.js.
// Import the module.
var Omx = require('node-omxplayer');
// Create an instance of the player with the source.
var player = Omx('my-video.mp4');
// Control video/audio playback.
player.pause();
player.volUp();
player.quit();
Warning: If you quit node before quitting the player, there is a chance of a zombie process being created, which will persist until the current audio/video track ends.
npm install node-omxplayer
This module does not require any third party Node.js libraries, but does rely on omxplayer being installed. On the default version of Raspbian it is installed by default, but on the Lite version you will have to install it:
sudo apt-get install omxplayer
The constructor method, used to launch omxplayer with a source.
source
(optional): The playback source, any audio or video file (or stream) that omxplayer is capable of playing. If left blank, the player will initialise and wait for a source to be added later with the newSource
method.
output
(optional): The audio output, if left blank will default to 'local', can be one of:
loop
(optional): Loop state, if set to true, will loop file if it is seekable. If left blank will default to false.
Warning: As stated above, if you quit node before quitting the player, a zombie process may be created. If this occurs when the loop option is in place, the omxplayer
process may run indefinitely.
volume
(optional): The initial volume, omxplayer will start with this value (in millibels). If left blank will default to 0.
win
(optional): Set position of video window. Should be in one of the following formats: 'x0 y0 x1 y1'
or x0,y0,x1,y1
. Consider pixel format for x
and y
values.
showOsd
(optional): If should display status information on screen.
aspectMode
(optional): Default is stretch if win is specified, letterbox otherwise.
subtitles
(optional): External subtitles in UTF-8 srt format.
align
(optional): Subtitle alignment, accepts 'center' or 'left' (default: left).
fontSize
(optional): Font size in 1/1000 screen height (default: 55).
ghostBox
(optional): If must show semitransparent boxes behind subtitles.
Starts playback of a new source, the arguments are identical to those of the Omx
constructor method described above. If a file is currently playing, ends this playback and begins the new source.
Resumes playback.
Pauses playback.
Increases the volume.
Decreases the volume.
Fast forwards playback.
Rewinds playback.
Skips playback forward by 30 seconds.
Skips playback backward by 30 seconds.
Skips playback forward by 600 seconds.
Skips playback backward by 600 seconds.
Quits the player.
Toggle subtitles.
Provides info on the currently playing file.
Increases playback speed.
Decreases playback speed.
Skips to previous chapter.
Skips to next chapter.
Skips to previous audio stream.
Skips to next audio stream.
Skips to previous subtitle stream.
Skips to next subtitle stream.
Decrease subtitle delay by 250ms.
Increase subtitle delay by 250ms.
Boolean giving the playback status, true
if the player is still active, false
if it has ended or the player has quit.
Fired when playback has finished.
Occurs when there is a problem with omxplayer. Includes a message with more information about the error.
Incorrect audio output type passed to the player, see Omx
in the API section above. Can occur for the Omx
constructor and the newSource
method.
An attempt has been made to send a command to the player after it has closed. Prevent this from happening by checking if it is still running using the running
getter method. Can occur for any of the player methods except newSource
.
FAQs
A library for controlling the Raspberry Pi omxplayer from Node.js.
The npm package @ffrm/node-omxplayer receives a total of 1 weekly downloads. As such, @ffrm/node-omxplayer popularity was classified as not popular.
We found that @ffrm/node-omxplayer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.