Control by cron

Linux related discussion about netjukebox
Locked
pvanthony
User
Posts: 1
Joined: Thu Nov 27, 2014 4:03 pm

Control by cron

Post 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
User avatar
wbartels
netjukebox developer
Posts: 881
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: Control by cron

Post 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.
Locked