Coder Social home page Coder Social logo

vabatta / omx-manager Goto Github PK

View Code? Open in Web Editor NEW
23.0 5.0 6.0 10.74 MB

Manager for Rpi omxplayer

Home Page: https://vabatta.github.com/omx-manager

License: MIT License

JavaScript 100.00%
omxplayer javascript loop video omx-manager raspberry-pi nodejs

omx-manager's People

Contributors

vabatta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

omx-manager's Issues

OmxManager is not a constructor

Hi,

when I add these two lines from the readme to my file:
var OmxManager = require('omx-manager'); var manager = new OmxManager(); // OmxManager

It just says "OmxManager is not a constructor" and ends execution.
Can you please help me with this?

Playing web radios

Hello,

Congrats for you work. Really nice.

I have a question:
This works perfectly:
omx.play('thelookoflove.mp3')

But I can't make it to work:
omx.play('http://199.180.72.6')
though I can play this very same URL at the comand line with
omxplayer http://199.180.72.6

Am I missing something? Any recommendation?

Best regards,

Sergio

Multiple instances of omxplayer

Hi

I want to play two video files simultaneously and side by side. How can I create multiple instances of omxplayer.

The following code does not work:

omx.play('videos/1.mp4', {'--loop': true, '--win' : "0 0 960 540"});
omx.play('videos/2.mp4', {'--loop': true, '--win' : "960 0 1920 540"});

--vol: 13

No difference in volume when changing the values on raspberry pi.

API suggestions

would be really great to be able to jump to a specific time, and a specific percent instead of just ff / rw. controls.

In addition (since they will be needed for those calculations) would be nice to expose the total length and current playback position in the get status, or some other method for creating a playback timeline progress bar UI

found some related dbus control commands in another project:
https://github.com/popcornmix/omxplayer/blob/master/dbuscontrol.sh

 duration=`dbus-send --print-reply=literal --session --reply-timeout=500 --dest=org.mpris.MediaPlayer2.omxplayer /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:"org.mpris.MediaPlayer2.Player" string:"Duration"`
[ $? -ne 0 ] && exit 1
duration="$(awk '{print $2}' <<< "$duration")"

position=`dbus-send --print-reply=literal --session --reply-timeout=500 --dest=org.mpris.MediaPlayer2.omxplayer /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:"org.mpris.MediaPlayer2.Player" string:"Position"`
[ $? -ne 0 ] && exit 1
position="$(awk '{print $2}' <<< "$position")"

 seek)
dbus-send --print-reply=literal --session --dest=org.mpris.MediaPlayer2.omxplayer /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Seek int64:$2 >/dev/null;;

 setposition)
dbus-send --print-reply=literal --session --dest=org.mpris.MediaPlayer2.omxplayer /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.SetPosition objpath:/not/used int64:$2 >/dev/null;;

How to handle errors?

Hey there. I'm using your manager and the only problem I have is when I try to handle error which occurs if file which I'm trying to play is not good.

Does your omx.play handle errors? I can't make it work.

PS: I'm quite fresh with node

Stop function didn't work on looping videos

I want to play multiple videos in loop. I'm using it like below.
var OmxManager = require('omx-manager');
var manager = new OmxManager(); // OmxManager
var omx = manager.create(videos, {'--loop': true}); // OmxInstance
omx.play();

But when I call omx.stop();, It only stop the current video that is playing. It again playing loop by starting with next video. I want to stop the omxplayer loop completely. How it can be possible?

Thanks for the help!

Instance.stop() calling crashes the app

App crashers while playing multiple videos, {'--loop': true}, if don't turn on loop the first video plays then ends
/home/pi/omxjs/omxplayer.js:44:9=>

if(dont_loop_all && video == last) instance.stop();

events.js:160
throw er; // Unhandled 'error' event
^

Error: This socket has been ended by the other party
at Socket.writeAfterFIN [as write] (net.js:290:12)
at KeyboardController._sendAction (/home/pi/omxjs/node_modules/omx-manager/lib/keyboardcontroller.js:63:29)
at KeyboardController.stop (/home/pi/omxjs/node_modules/omx-manager/lib/keyboardcontroller.js:85:14)
at dontLoopLast (/home/pi/omxjs/omxplayer.js:29:53)
at KeyboardController. (/home/pi/omxjs/omxplayer.js:44:9)
at emitNone (events.js:86:13)
at KeyboardController.emit (events.js:185:7)
at KeyboardController._setStopState (/home/pi/omxjs/node_modules/omx-manager/lib/omxinstance.js:84:12)
at ChildProcess.respawn (/home/pi/omxjs/node_modules/omx-manager/lib/omxinstance.js:115:20)
at ChildProcess.g (events.js:292:16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.