$start_time, 'begin'=> $begin, 'src' => $name, 'dur' => $dur, 'in' => $in, 'out' => $out); $begin += $out - $in; } echo json_encode($videos); } } // start / stop playout if(!empty($_POST['playout'])) { $state = $_POST['playout']; if ($state === "start") { $out = shell_exec("./sh/playout.sh start"); echo "Started Playout"; } else if ($state === "stop") { $out = shell_exec("./sh/playout.sh stop"); echo "Stoped Playout"; } echo "$out"; }