You are here

function video_submit in Video 5

Same name and namespace in other branches
  1. 6.2 video.module \video_submit()

Implementation of hook submit

File

./video.module, line 735
Display video in Quicktime MOV, Realmedia RM, Flash FLV & SWF, or Windows Media WMV formats.

Code

function video_submit(&$node) {
  if (video_support_autoresolution($node)) {

    // vtype support autoresolution getting
    $xy = module_invoke('video_' . $node->vtype, 'v_auto_resolution', $node);
    if ($xy) {
      $node->videox = $xy[0];
      $node->videoy = $xy[1];
    }
  }
  else {

    // we should have a good value (checked by Form API)
    if ($node->vresolution) {
      $res = explode('x', variable_get('video_resolution_' . $node->vresolution . '_value', ''));
      $node->videox = $res[0];
      $node->videoy = $res[1];
    }
  }
  if (video_support_autoplaytime($node)) {

    // vtype support auto playtime
    $node->playtime_seconds = module_invoke('video_' . $node->vtype, 'v_auto_playtime', $node);
  }
  else {

    // vtype does not support auto_playtime
    $node->playtime_seconds += $node->playtime_hours * 3600 + $node->playtime_minutes * 60;
  }
}