Quote Originally Posted by vshare View Post
This will fix the duration problem.

Open admin/video_add_flv_2.php

find the code
Code:
$sql = "INSERT INTO `videos` SET
               `video_user_id`=" . (int) $video_user_id . ",
               `video_title`='" . mysql_clean($video_title) . "',
               `video_description`='" . mysql_clean($video_description) . "',
               `video_keywords`='" . mysql_clean($upload_video_keywords) . "',
               `video_seo_name`='" . seo_name($video_title) . "',
               `video_embed_code`='" . mysql_clean($embed_code) . "',
               `video_channels`='0|$video_channels|0',
               `video_type`='$video_type',
               `video_vtype`=$vtype,
               `video_adult`='$video_adult',
               `video_duration`=1,
               `video_length`='01:00',
               `video_add_time`='" . time() . "',
               `video_add_date`='" . date("Y-m-d") . "',
               `video_active`='1',
               `video_approve`='$config[approve]'";
replace it with

Code:
$video_duration = '1';
        $video_length = '01:00';
        
        if (preg_match("/youtube/i", $embed_code))
        {
            if (preg_match('/v=(.*)/i', $embed_code, $matches))
            {
                if (isset($matches[1]))
                {
                    require_once '../include/class.bulk_import.php';
                    require 'Zend/Loader.php';
                    Zend_Loader::loadClass('Zend_Gdata_YouTube');
                    
                    $matches_arr = explode('&', $matches[1]);
                    $youtube_video_id = $matches_arr[0];
                    
                    $youtube_video_info =     BulkImport::getYoutubeVideoInfo($youtube_video_id);
                    
                    $video_duration = $youtube_video_info['video_duration'];
                    $video_length = sec2hms($youtube_video_info['video_duration']);
                }
            }
        }
        
        $sql = "INSERT INTO `videos` SET
               `video_user_id`=" . (int) $video_user_id . ",
               `video_title`='" . mysql_clean($video_title) . "',
               `video_description`='" . mysql_clean($video_description) . "',
               `video_keywords`='" . mysql_clean($upload_video_keywords) . "',
               `video_seo_name`='" . seo_name($video_title) . "',
               `video_embed_code`='" . mysql_clean($embed_code) . "',
               `video_channels`='0|$video_channels|0',
               `video_type`='$video_type',
               `video_vtype`=$vtype,
               `video_adult`='$video_adult',
               `video_duration`='" . (int) $video_duration . "',
               `video_length`='" . mysql_clean($video_length) . "',
               `video_add_time`='" . time() . "',
               `video_add_date`='" . date("Y-m-d") . "',
               `video_active`='1',
               `video_approve`='$config[approve]'";
Thanks.

I changed the code as shown above but still the runtime of video in "videos being watched......" and in "new videos" section as well , runtimes appear as 1:00 . Pls help in changing the code so that actual runtimes of the video appear on the video. thanks in advance.