Control by cron

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

Control by cron

Post by pvanthony » Thu Nov 27, 2014 4:57 pm

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: 792
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: Control by cron

Post by wbartels » Sat Nov 29, 2014 12:11 pm

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.

Post Reply