Example #1
0
 function fetchAndConvert($username, $password, $uri, $callback, $watermark_uri)
 {
     $customerId = getCustomerId($username, $password);
     if (!$customerId || empty($uri)) {
         return false;
     }
     $id = addProcessEvent(PROCESS_FETCH, $customerId, $uri);
     $params['callback'] = $callback;
     $params['watermark'] = $watermark_uri;
     $endId = addProcessEvent(PROCESS_CONVERT_TO_DEFAULT, $customerId, $id, $params);
     return $endId;
 }
Example #2
0
 $fileId = $event['referId'];
 $added = false;
 if (!empty($_POST['dst_audio_fmt'])) {
     $added = addProcessEvent(PROCESSQUEUE_AUDIO_RECODE, $h->session->id, $fileId, $_POST['dst_audio_fmt']);
 } else {
     if (!empty($_POST['dst_image_fmt'])) {
         $added = addProcessEvent(PROCESSQUEUE_IMAGE_RECODE, $h->session->id, $fileId, $_POST['dst_image_fmt']);
     } else {
         if (!empty($_POST['dst_video_fmt'])) {
             $added = addProcessEvent(PROCESSQUEUE_VIDEO_RECODE, $h->session->id, $fileId, $_POST['dst_video_fmt']);
         } else {
             if (isset($_GET['process'])) {
                 $added = addProcessEvent(PROCESSPARSE_AND_FETCH, $h->session->id, $fileId);
             } else {
                 if (!empty($_POST['unfetched_process']) && $_POST['unfetched_process'] == 'convert') {
                     $added = addProcessEvent(PROCESS_CONVERT_TO_DEFAULT, $h->session->id, $this->owner);
                 }
             }
         }
     }
 }
 if ($added) {
     echo 'Work order has been enqueued.<br/><br/>';
     echo ahref('queue/status/' . $fileId, 'Show file status') . '<br/><br/>';
     echo '<a href="show_queue.php">Show active queue</a>';
     return;
 }
 if ($event['orderType'] == TASK_FETCH) {
     echo '<h1>convert unfetched media</h1>';
     echo 'The following order has not yet been processed and media type cannot be determined.<br/><br/>';
     echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?id=' . $this->owner . '">';