Ejemplo n.º 1
0
 public function startRecordOnStb()
 {
     $ch_id = intval($_REQUEST['ch_id']);
     $file = $_REQUEST['file'];
     $start_ts = (int) $_REQUEST['start_ts'];
     $stop_ts = (int) $_REQUEST['stop_ts'];
     $internal_id = $_REQUEST['internal_id'];
     $channel = Mysql::getInstance()->from('itv')->where(array('id' => $ch_id))->get()->first();
     if (empty($channel)) {
         return false;
     }
     $recorder = new StreamRecorder();
     $rec_id = $recorder->startNow($channel, true);
     if ($rec_id) {
         Mysql::getInstance()->update('users_rec', array('file' => $file, 't_start' => date("Y-m-d H:i:s", $start_ts), 't_stop' => date("Y-m-d H:i:s", $stop_ts), 'length' => $stop_ts - $start_ts, 'internal_id' => $internal_id), array('id' => $rec_id));
     }
     return $rec_id;
 }