load->helper('url_shortener'); if(!count($pd_master_details)) { $pd_master_details = $CI->PD_Model->getPDMasterDetails($pd_id,$random_string); } $bucket_name = LENDER_BUCKET_NAME_PREFIX.$pd_master_details[0]['fk_lender_id']; $result_data = array(); $query = "SELECT * FROM ".VIDEO_ROOM_INFO." where fk_pd_id = $pdid and isactive = 1"; $video_info = $CI->db->query($query); if($video_info->num_rows()) { $video_info = $video_info->result_array(); // $uri = url_shortener::url_shorten($pdid,$random_string); //print_r($video_info);die(); foreach ($video_info as $key => $value) { $video_name = $value['composition_id'].'.mp4'; if($value['is_uploaded']){$video_name = $value['composition_id'];} $file_name = $video_name; $date_of_creation = date('Ymd'); $shorten_url = custom_encryption::encode( 'vdo/'.$date_of_creation.'/'.$pdid.'/'.$value['composition_id']); $shorten_url = PDF_ATTACHEMENT_URL.$shorten_url; // $shorten_url = (!empty($uri['vdo']) && ($uri[$key]['video_name'] = $value['composition_id'])) ? PDF_ATTACHEMENT_URL.$uri['vdo'][$key]['url'] : ""; if($value['s3_copied']) { $final_key = 'pd'.$pd_master_details[0]['pd_id'].'/video/'.$file_name; $singed_uri = $CI->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$final_key,'+7 days'); $result_data[] = array('video_name' => $video_name,'s3_url' => $singed_uri,'url'=>$shorten_url,'status' => $value['twilo_status'],'room_id' => $value['room_id'],'id' => $value['video_room_info_id']); } else { $result_data[] = array('video_name' => $video_name, 's3_url' => '','url'=>'','status' =>'processing','room_id' => $value['room_id'],'id' => $value['video_room_info_id']); } } } return $result_data; } public function deleteVideo($id) { $CI =&get_instance(); $updateRows = array('isactive' => 0); $CI->db->where('video_room_info_id =',$id); $CI->db->update(VIDEO_ROOM_INFO, $updateRows); $affectedRows = $CI->db->affected_rows(); return (($affectedRows > 0 ) ? "Deleted successfully" : "Fail to Delete"); } } ?>