You are here

function emvideo_field in Embedded Media Field 6.2

Same name and namespace in other branches
  1. 6.3 contrib/emvideo/emvideo.module \emvideo_field()
  2. 6 contrib/emvideo/emvideo.module \emvideo_field()

Implementation of hook_field().

File

contrib/emvideo/emvideo.module, line 323
Embedded Video module is a handler for 3rd party video files.

Code

function emvideo_field($op, &$node, $field, &$items, $teaser, $page) {
  $ret = emfield_emfield_field($op, $node, $field, $items, $teaser, $page, 'emvideo');
  if ($op == 'presave') {
    foreach ($items as $delta => $item) {
      $duration = emfield_include_invoke('emvideo', $item['provider'], 'duration', $item);
      $items[$delta]['duration'] = $duration ? $duration : 0;
    }
  }
  return $ret;
}