function VideoFile::createSourceField

Same name in other branches
  1. 9 core/modules/media/src/Plugin/media/Source/VideoFile.php \Drupal\media\Plugin\media\Source\VideoFile::createSourceField()
  2. 8.9.x core/modules/media/src/Plugin/media/Source/VideoFile.php \Drupal\media\Plugin\media\Source\VideoFile::createSourceField()
  3. 10 core/modules/media/src/Plugin/media/Source/VideoFile.php \Drupal\media\Plugin\media\Source\VideoFile::createSourceField()

Overrides File::createSourceField

File

core/modules/media/src/Plugin/media/Source/VideoFile.php, line 27

Class

VideoFile
Media source wrapping around a video file.

Namespace

Drupal\media\Plugin\media\Source

Code

public function createSourceField(MediaTypeInterface $type) {
    return parent::createSourceField($type)->set('settings', [
        'file_extensions' => 'mp4',
    ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.