Video_Post::get_iso_duration()

Return duration in ISO format (ie. PT1H43M23S)


Return

(string)


Source

File: includes/libs/video-post.class.php

497public function get_iso_duration(){
498    $seconds = $this->duration;
499    $iso_format = 'PT';
500 
501    if ( $seconds > 3600 ) {
502        $hours = floor( $seconds / 3600 );
503        $iso_format .= $hours . 'H';
504        $seconds = $seconds - ( $hours * 3600 );
505    }
506 
507    if ( $seconds > 60 ) {
508        $minutes = floor( $seconds / 60 );
509        $iso_format .= $minutes . 'M';
510        $seconds = $seconds - ( $minutes * 60 );
511    }
512 
513    if ( $seconds > 0 ) {
514        $iso_format .= $seconds . 'S';
515    }
516 
517    return $iso_format;
518}

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!