- /**
- * Request content_ingest to the CIS in order to start the content
- * ingestion process.
- *
- * @param string $activation_code
- * @param string $raw_video_fn uploaded video file name
- * @param string $name
- * @param int $raw_video_size uploaded video file size in bytes
- * @param array $transcode_configs dictionary which must be included in
- * the JSON data that needs to be sent to CIS
- * @return mixed return the HTTP content (body) on success and FALSE
- * otherwise
- */
- protected function _send_content_ingestion($activation_code, $raw_video_fn,
- $name, $raw_video_size, $transcode_configs)
- {
- $this->config->load('content_ingestion');
-
- $url = $this->config->item('cis_url') . 'ingest_content';
- $data = array(
- 'code'=>$activation_code,
- 'raw_video'=>$raw_video_fn,
- 'name'=>$name,
- 'weight'=>$raw_video_size,
- 'transcode_configs'=>$transcode_configs,
- 'thumbs'=>$this->config->item('thumbs_count')
- );
- $json_data = json_encode($data);
-
- // Send request to CIS.
- $r = new HttpRequest($url, HttpRequest::METH_POST);
- $r->setBody($json_data);
- try
- {
- $response = $r->send()->getBody();
- }
- catch (HttpException $ex)
- {
- return FALSE;
- }
-
- return $response;
- }
-