You are here

function emvideo_field in Embedded Media Field 6

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

Implementation of hook_field().

File

contrib/emvideo/emvideo.module, line 273
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;
}