Video_Post::get_iso_duration()

Return duration in ISO format (ie. PT1H43M23S)


Return

(string)


Source

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

	public function get_iso_duration(){
		$seconds = $this->duration;
		$iso_format = 'PT';

		if ( $seconds > 3600 ) {
			$hours = floor( $seconds / 3600 );
			$iso_format .= $hours . 'H';
			$seconds = $seconds - ( $hours * 3600 );
		}

		if ( $seconds > 60 ) {
			$minutes = floor( $seconds / 60 );
			$iso_format .= $minutes . 'M';
			$seconds = $seconds - ( $minutes * 60 );
		}

		if ( $seconds > 0 ) {
			$iso_format .= $seconds . 'S';
		}

		return $iso_format;
	}

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!