You are here

function emvideo_youtube_duration in Embedded Media Field 6

hook emvideo_PROVIDER_duration($item) Returns the duration of the video in seconds.

Parameters

$item: The video item itself, which needs the $data array. @return The duration of the video in seconds.

File

contrib/emvideo/providers/youtube.inc, line 368
This include processes youtube.com media files for use by emfield.module.

Code

function emvideo_youtube_duration($item) {
  if (!isset($item['data']['emvideo_youtube_version']) || $item['data']['emvideo_youtube_version'] < 3) {
    $item['data'] = emvideo_youtube_data(NULL, $item);
  }
  return isset($item['data']['duration']) ? $item['data']['duration'] : 0;
}