You are here

function video_submit in Video 6.2

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

Implementation of hook submit

File

./video.module, line 839
video.module

Code

function video_submit(&$node) {
  if (video_support_autoresolution($node) && $node->new_video_upload_file_fid) {

    // 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 {

    // if you have a existing value from hidden field
    if ($node->hvresolution) {
      $res = explode('x', $node->hvresolution);
      $node->videox = $res[0];
      $node->videoy = $res[1];
      $node->size = $node->hsize;
    }
    else {
      if ($node->vresolution < VIDEO_MANUALLY_SET_VIDEO_RESOLUTION_SELECT_ID) {
        $res = explode('x', variable_get('video_resolution_' . $node->vresolution . '_value', ''));
        $node->videox = $res[0];
        $node->videoy = $res[1];
      }
      else {
        if ($node->vresolution == VIDEO_MANUALLY_SET_VIDEO_RESOLUTION_SELECT_ID) {

          // this is a manually set video resolution
          $node->videox = $node->manual_resolution_width;
          $node->videoy = $node->manual_resolution_height;
        }
      }
    }
  }
  if (video_support_autoplaytime($node) && $node->new_video_upload_file_fid) {

    // 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;
  }
}