video_grabber_helper.php for short_url : ps
This commit is contained in:
parent
8611a4e9d7
commit
bee69d1547
@ -12,6 +12,7 @@ class video_grabber_helper
|
|||||||
public function grabAllVideo($pdid,$random_string,$pd_master_details = array())
|
public function grabAllVideo($pdid,$random_string,$pd_master_details = array())
|
||||||
{
|
{
|
||||||
$CI =&get_instance();
|
$CI =&get_instance();
|
||||||
|
$CI->load->helper('url_shortener');
|
||||||
|
|
||||||
if(!count($pd_master_details))
|
if(!count($pd_master_details))
|
||||||
{
|
{
|
||||||
@ -25,21 +26,23 @@ class video_grabber_helper
|
|||||||
if($video_info->num_rows())
|
if($video_info->num_rows())
|
||||||
{
|
{
|
||||||
$video_info = $video_info->result_array();
|
$video_info = $video_info->result_array();
|
||||||
|
$uri = url_shortener::url_shorten($pdid,$random_string);
|
||||||
//print_r($video_info);die();
|
//print_r($video_info);die();
|
||||||
foreach ($video_info as $key => $value)
|
foreach ($video_info as $key => $value)
|
||||||
{
|
{
|
||||||
$video_name = $value['composition_id'].'.mp4';
|
$video_name = $value['composition_id'].'.mp4';
|
||||||
if($value['is_uploaded']){$video_name = $value['composition_id'];}
|
if($value['is_uploaded']){$video_name = $value['composition_id'];}
|
||||||
$file_name = $video_name;
|
$file_name = $video_name;
|
||||||
|
$shorten_url = (!empty($uri['vdo']) && ($uri[$key]['video_name'] = $value['composition_id'])) ? $uri['vdo'][$key]['url'] : "";
|
||||||
if($value['s3_copied'])
|
if($value['s3_copied'])
|
||||||
{
|
{
|
||||||
$final_key = 'pd'.$pd_master_details[0]['pd_id'].'/video/'.$file_name;
|
$final_key = 'pd'.$pd_master_details[0]['pd_id'].'/video/'.$file_name;
|
||||||
$singed_uri = $CI->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$final_key,'+7 days');
|
$singed_uri = $CI->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$final_key,'+7 days');
|
||||||
$result_data[] = array('video_name' => $video_name,'url' => $singed_uri,'status' => $value['twilo_status'],'room_id' => $value['room_id'],'id' => $value['video_room_info_id']);
|
$result_data[] = array('video_name' => $video_name,'url' => $singed_uri,'shorten_url'=>$shorten_url,'status' => $value['twilo_status'],'room_id' => $value['room_id'],'id' => $value['video_room_info_id']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$result_data[] = array('video_name' => $video_name, 'url' => '','status' =>'processing','room_id' => $value['room_id'],'id' => $value['video_room_info_id']);
|
$result_data[] = array('video_name' => $video_name, 'url' => '','shorten_url'=>$shorten_url,'status' =>'processing','room_id' => $value['room_id'],'id' => $value['video_room_info_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user