It then double comma's each extension like this

mp4,, mov,, flv,, m4v,, mpg,, mpeg,, ogg,, ogv,, mp3,, oga

Comments

mikeytown2’s picture

typo in the error; it should read videofield instead of videoftp.

/**
 * Implementation of CCK's hook_widget_settings($op = 'validate').
 */
function uploadfield_widget_settings_validate($widget) {
  // Check that only web images are specified in the callback.
  if(!video_web_extensions($widget['file_extensions'])) {
    form_set_error('file_extensions', t('Only web-standard videos are supported through the videofield widget. If needing to upload other types of files, change the widget to use a standard file upload.'));
  }
}
mikeytown2’s picture

One more question; If I'm using FFMPEG shouldn't I be able to upload just about any video type and it will be converted? why limit it to only these listed here?

/**
 * Compares passed extensions with normal video web extensions.
 */
function video_web_extensions($ext) {
  $extensions = array_filter(explode(' ', $ext));
  $web_extensions = array(
    'mov', 'mp4', '3gp', '3g2', 'mpg', 'mpeg', // quicktime
    'divx', //divx
    'rm', // realplayer
    'flv', 'f4v', //flash player
    'swf', // swf player
    'dir', 'dcr', // dcr player
    'asf', 'wmv', 'avi', 'mpg', 'mpeg', // windows media
    'ogg',
    'ogv', // ogg/ogv theora
  );
  if (count(array_diff($extensions, $web_extensions))) {
    return FALSE;
  }
  return TRUE;
}
hypertext200’s picture

If you can send us any more video types, we can add them, please send with the player support on them. those are the major video type which ppl will use.

xiong’s picture

m4v format is very popular and is much used among video production industry afaik, would you please updated it in? thanks!

hypertext200’s picture

Status: Active » Closed (fixed)