All video duration are 1 minute. Why?
Please help me!
Many thanks!
Printable View
All video duration are 1 minute. Why?
Please help me!
Many thanks!
How you added video ?
Upload -> title,details,tags,category -> youtube link (http://www.youtube.com/watch?v=xyz)
Open a suport ticket with url to forum post at
BuyScripts Helpdesk
public_html\admin\video_add_flv_2.php
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]'";
When you add embeded code, there is no way to find video length. One solution is to add a text box, so admin can specify video length while adding video.
I use direct (youtube) link. Not the embeded.
This will fix the duration problem.
Open admin/video_add_flv_2.php
find the code
replace it withCode:$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]'";
Thanks.Code:$video_duration = '1';
$video_length = '01:00';
if (preg_match("/youtube/i", $embed_code))
{
if (preg_match('/v\/(.[a-zA-Z0-9]+)/i', $embed_code, $matches) || preg_match('/v=(.[a-zA-Z0-9]+)/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]'";
Thank you! :)
I will try .
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.