diff -u b/core/modules/media/src/MediaSourceInterface.php b/core/modules/media/src/MediaSourceInterface.php --- b/core/modules/media/src/MediaSourceInterface.php +++ b/core/modules/media/src/MediaSourceInterface.php @@ -143,20 +143,26 @@ * Gets the options for the source field in the form/view display. * + * The display options must have the same structure like the options for + * \Drupal\Core\Entity\Display\EntityDisplayInterface::setComponent(). + * Returning an empty array means that the default display options of the + * source field will be used. If the $display_context is 'view', then the + * returned array must be a set of formatter options (i.e, for an entity view + * display), and if the $display_context is 'form', the returned array must be + * a set of widget options (i.e., for an entity form display). + * * @param \Drupal\media\MediaTypeInterface $type * The media type which is using this source. * @param string $display_context * The display context which will use these options. Can be 'view' or 'form. + * @param string $view_mode + * The view mode of the display. * * @return array|bool * The display options, or FALSE for removing this component from * the display. - * The display options must have the same structure like the options for - * EntityDisplayInterface::setComponent($name, array $options = []). - * Returning an empty array means that the default display options of the - * source field will be used. * * @see \Drupal\Core\Entity\Display\EntityDisplayInterface::setComponent() */ - public function getDisplayOptions(MediaTypeInterface $type, $display_context); + public function getDisplayOptions(MediaTypeInterface $type, $display_context, $view_mode = 'default'); }