When programmatically adding file field, how to set allowed file extensions?
The allowed file extension settings are added to the field instance settings, rather than the global field settings.

The variable is called 'file_extensions' and not 'allowed_file_extensions'

It is also a textfield string value, rather than an array.

You could try something like:

field_create_field(array(
    'field_name' =&gt; 'xxx_video',
    'type' =&gt; 'file',
    'entity_type' =&gt; array('node'),
));
field_create_instance(array(
  'field_name' =&gt; 'xxx_video',
  'required' =&gt; true,
  'entity_type' =&gt; 'node',
  'bundle' =&gt; 'xxx',
  'label' =&gt; t('Video'),
  'settings' =&gt; array('file_extensions' =&gt; 'mp4, avi'),
  'description' =&gt; t('Video to play in smartbox.'),
));