Helper::get_duration( string $before = '<span class="duration">', string $after = '</span>', bool $echo = true )

Get the video duration


Parameters

$before

(Optional)

Default value: '<span class="duration">'

$after

(Optional)

Default value: '</span>'

$echo

(Optional)

Default value: true


Return

(string|void)


Source

File: includes/libs/themes/helper.class.php

189public static function get_duration( $before = '<span class="duration">', $after = '</span>', $echo = true ){
190    $video = self::current_video_post();
191    if( !$video ){
192        return;
193    }
194 
195    $output = sprintf(
196        '%s%s%s',
197        $before,
198        \Vimeotheque\Helper::human_time( $video->duration ),
199        $after
200    );
201 
202    if( $echo ){
203        echo $output;
204    }
205 
206    return $output;
207}

Start your video site now!

Manage and coordinate your Vimeo channels, albums or videos with your WordPress website. Perfect fit for membership, portfolio, online courses or any type of video collection.

Get Vimeotheque PRO!