Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Duration problem

  1. #1
    Join Date
    Jul 2010
    Posts
    14

    Default Duration problem

    All video duration are 1 minute. Why?

    Please help me!

    Many thanks!

  2. #2
    Join Date
    Sep 2007
    Posts
    906

    Default

    How you added video ?
    vShare Hosting, vShare Installation, Server Setup, Lighttpd streaming, vShare Templates
    [email protected]

  3. #3
    Join Date
    Jul 2010
    Posts
    14

    Default

    Upload -> title,details,tags,category -> youtube link (http://www.youtube.com/watch?v=xyz)

  4. #4
    Join Date
    Sep 2007
    Posts
    906

    Default

    Open a suport ticket with url to forum post at

    BuyScripts Helpdesk
    vShare Hosting, vShare Installation, Server Setup, Lighttpd streaming, vShare Templates
    [email protected]

  5. #5
    Join Date
    Jul 2010
    Posts
    14

    Default

    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]'";

  6. #6
    Join Date
    Sep 2007
    Posts
    906

    Default

    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.
    Last edited by hostonnet; 07-18-2010 at 03:32 PM.
    vShare Hosting, vShare Installation, Server Setup, Lighttpd streaming, vShare Templates
    [email protected]

  7. #7
    Join Date
    Jul 2010
    Posts
    14

    Default

    I use direct (youtube) link. Not the embeded.

  8. #8
    Join Date
    Dec 2009
    Posts
    71

    Default

    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\/(.[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]'";
    Thanks.
    Last edited by vshare; 09-04-2010 at 08:39 AM.

  9. #9
    Join Date
    Jul 2010
    Posts
    14

    Default

    Thank you! :)

    I will try .

  10. #10
    Join Date
    Sep 2010
    Posts
    15

    Default Still runtimes show as 1:00

    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.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •