Page 1 of 1

Control by cron

Posted: Thu Nov 27, 2014 4:57 pm
by pvanthony
Hi,

Is there a way to pause and start a playlist or music player daemon using cron? Like using curl with http://something?action=pause. If there is another way please let me know.

We need netjukebox to start and stop at specific time.

P.V.Anthony

Re: Control by cron

Posted: Sat Nov 29, 2014 12:11 pm
by wbartels
This is not implemented in netjukebox 6.05.
But for now you can add an little pause.php script:

Code: Select all

<?php 
if (PHP_SAPI != 'cli')
	exit();

require_once('include/initialize.inc.php');
require_once('include/play.inc.php');

if ($cfg['player_type'] == NJB_HTTPQ)
	httpq('pause');
elseif ($cfg['player_type'] == NJB_VLC)
	vlc('pl_pause');
elseif ($cfg['player_type'] == NJB_MPD)
	mpd('pause');
and run:

Code: Select all

php pause.php
This will toggle between play and pause.
For more info look at the play.php script.