Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: Runtime - in Minutes/Seconds?

  1. #1

    Default Runtime - in Minutes/Seconds?

    Can we get RUNTIME in minutes and seconds?

    And when I see "Runtime: 232.73", what exactly does that mean?

    Is that 232.73 seconds?

    Right now, I'm also getting strange behavior from the "Runtime" feature... Every few videos, one will upload with a "0" runtime, even when it's several minutes long.

  2. #2
    Join Date
    Apr 2007
    Posts
    2,202

    Default

    To show duration in minutes and seconds, edit /tmplates/index.tpl

    FIND

    Code:
    Runtime: {$answers[i].duration|string_format:"%.2f"} |
    REPLACE WITH

    Code:
    {assign var=viddur value=$answers[i].duration} 
    {math equation="$viddur/60" format="%0.0f" assign=minutes} 
    {math equation="$viddur - ($minutes * 60)" format="%0.0f" assign=seconds} 
    {if $seconds < 0} 
    {math equation="$minutes - 1" assign=minutes} 
    {math equation="$seconds + 60" assign=seconds} 
    {/if}            
    Runtime: {$minutes}m{$seconds}s |
    We will look into the duration problem, this may be due to ffmpeg-php is not able to get duration from video format you are uploading.

  3. #3

    Default

    Thanks for that, but it looks like the runtime has to be manually changed in several templates, which I'm not real sure how to do.

    It would be awesome if you could select between the two runtime formats through the admin panel.

  4. #4
    Join Date
    May 2007
    Posts
    98

    Default

    Agreed, runtime in minutes and seconds would be the most logical.

  5. #5

    Default

    I concour!

  6. #6
    Join Date
    May 2007
    Posts
    588

    Default

    i changed it in all the templates but it only works on index.tpl.....admin can we have it working on all pages?

  7. #7

    Default

    I changed it where necessary, but the code on line 186 of video.tpl is slightly different, and doesn't work when you replace it with:
    Code:
    Runtime: {$answers[i].duration|string_format:"%.2f"} |
    The rest work ok.
    Look, it's not steep till you need to stop ok !

  8. #8
    Join Date
    Jun 2007
    Posts
    21

    Default

    The changes I made in version: 2.1 Release: 20070530
    as follows. I suggest you BACKUP YOUR FILES. The easiest way is to rename your current file right on the server before you upload your hacked file.
    ie: view-video.orig.tpl


    view-video.tpl
    Code:
    {assign var=viddur value=$vinfo[0].duration}
    {math equation="$viddur/60" format="%0.0f" assign=minutes}
    {math equation="$viddur - ($minutes * 60)" format="%0.0f" assign=seconds}
    {if $seconds < 0}
    {math equation="$minutes - 1" assign=minutes}
    {math equation="$seconds + 60" assign=seconds}
    {/if}           
    Runtime: {$minutes}m-{$seconds}s
    I added the hyphen between minutes/seconds also, whatever ........
    REF: http://www.tubebucket.com/


    index.tpl
    Code:
    {assign var=viddur value=$answers[i].duration}
    {math equation="$viddur/60" format="%0.0f" assign=minutes}
    {math equation="$viddur - ($minutes * 60)" format="%0.0f" assign=seconds}
    {if $seconds < 0}
    {math equation="$minutes - 1" assign=minutes}
    {math equation="$seconds + 60" assign=seconds}
    {/if}           
    Runtime: {$minutes}m - {$seconds}s
    There are two changes in channel-detail.tpl

    Look for:
    Code:
    Runtime: {$recadd[j].duration|string_format:"%.2f"}
    Replace with:
    Code:
    {assign var=viddur value=$recadd[j].duration}
    {math equation="$viddur/60" format="%0.0f" assign=minutes}
    {math equation="$viddur - ($minutes * 60)" format="%0.0f" assign=seconds}
    {if $seconds < 0}
    {math equation="$minutes - 1" assign=minutes}
    {math equation="$seconds + 60" assign=seconds}
    {/if}           
    Runtime: {$minutes}m-{$seconds}s


    Look for:
    Code:
    Runtime: {$mostview[k].duration|string_format:"%.2f"}
    Replace with:
    Code:
    {assign var=viddur value=$mostview[k].duration}
    {math equation="$viddur/60" format="%0.0f" assign=minutes}
    {math equation="$viddur - ($minutes * 60)" format="%0.0f" assign=seconds}
    {if $seconds < 0}
    {math equation="$minutes - 1" assign=minutes}
    {math equation="$seconds + 60" assign=seconds}
    {/if}           
    Runtime: {$minutes}m-{$seconds}s
    Regards, HE

  9. #9

    Default

    Nice one!
    Cheers HE
    Look, it's not steep till you need to stop ok !

  10. #10
    Join Date
    Jun 2007
    Posts
    197

    Default

    Quote Originally Posted by Philthy
    Nice one!
    Cheers HE
    Same here cheers!
    ------------------------------------
    Make an arse of yourself:
    http://www.youtwatonline.com
    ------------------------------------

Page 1 of 3 123 LastLast

Similar Threads

  1. Runtime in s Fix to MM:SS
    By nikhom in forum Fixed Bugs
    Replies: 1
    Last Post: 12-23-2007, 06:54 AM
  2. Time in MINUTES AND SECONDS
    By grynmoors in forum Feature Requests
    Replies: 2
    Last Post: 11-09-2007, 12:16 AM
  3. Video duration in minutes and seconds
    By starapple in forum Fixed Bugs
    Replies: 2
    Last Post: 07-31-2007, 01:02 PM
  4. Feature Request: Show runtime in Minutes:Seconds
    By grynmoors in forum Feature Requests
    Replies: 1
    Last Post: 07-07-2007, 09:40 AM

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
  •