Omxplayer Wrapper and cron - Raspberry Pi Forums
hi everyone.
looking build network controlled media player using pi. have been playing around omxplayer wrapper neatly wraps dbus control of omxplayer.
have used following code looks files in location , plays first file finds. works great when run terminal or when logged in through ssh.
works fine when launched terminal not when launched cron on boot. movie plays not paused , rewound assume dbus not connecting.
have search issues when using cron , dbus , seems issue solutions way above understanding. wondering if can point me in direction of useful sites/articles might me working.
thanks
steve
looking build network controlled media player using pi. have been playing around omxplayer wrapper neatly wraps dbus control of omxplayer.
have used following code looks files in location , plays first file finds. works great when run terminal or when logged in through ssh.
code: select all
from omxplayer import omxplayer time import sleep import glob files =[] files = glob.glob("/home/pi/*.mov") print files[0] player = omxplayer(files[0]) player.play() print player.volume() print player.position() sleep(5) player.pause() sleep(5) player.set_volume(0.5) player.set_position(0) player.play() print player.volume() print player.position() sleep(5) # kill `omxplayer` process gracefully. player.quit()
have search issues when using cron , dbus , seems issue solutions way above understanding. wondering if can point me in direction of useful sites/articles might me working.
thanks
steve
are saying that:
, rest of code works?
code: select all
... player = omxplayer(files[0]) player.play() # <-- code works , including line print player.volume() print player.position() sleep(5) player.pause() sleep(5) player.set_volume(0.5) player.set_position(0) # <-- 1 not work!!?? player.play() print player.volume() print player.position() sleep(5) # kill `omxplayer` process gracefully. player.quit()
raspberrypi
Comments
Post a Comment