You are here

function scald_video_get_video_file in Scald: Media Management made easy 7

Saves a video file from a form's file value.

2 calls to scald_video_get_video_file()
scald_video_form_scald_atom_add_form_options_submit in modules/providers/scald_video/scald_video.module
Atom's form save and edit submit callback.
scald_video_scald_add_form_fill in modules/providers/scald_video/scald_video.module
Implements hook_scald_add_form_fill().

File

modules/providers/scald_video/scald_video.module, line 346
Scald Video is a Scald Atom Provider for video files.

Code

function scald_video_get_video_file($file_form_value, $location = NULL) {
  if (is_null($location)) {
    $location = variable_get('scald_video_upload_location', 'public://atoms/video/');
  }
  if (is_array($file_form_value) && module_exists('plupload')) {
    module_load_include('inc', 'scald', 'includes/scald.plupload');
    $file = scald_plupload_save_file($file_form_value['tmppath'], $location . $file_form_value['name']);
  }
  else {
    $file = file_load($file_form_value);
  }
  return $file;
}