You are here

public function Facebook::prepareViewDisplay in Media entity facebook 3.x

Prepares the media type fields for this source in the view display.

This method should normally call \Drupal\Core\Entity\Display\EntityDisplayInterface::setComponent() or \Drupal\Core\Entity\Display\EntityDisplayInterface::removeComponent() to configure the media type fields in the view display.

Parameters

\Drupal\media\MediaTypeInterface $type: The media type which is using this source.

\Drupal\Core\Entity\Display\EntityViewDisplayInterface $display: The display which should be prepared.

Overrides MediaSourceBase::prepareViewDisplay

See also

\Drupal\Core\Entity\Display\EntityDisplayInterface::setComponent()

\Drupal\Core\Entity\Display\EntityDisplayInterface::removeComponent()

File

src/Plugin/media/Source/Facebook.php, line 205

Class

Facebook
Facebook entity media source.

Namespace

Drupal\media_entity_facebook\Plugin\media\Source

Code

public function prepareViewDisplay(MediaTypeInterface $type, EntityViewDisplayInterface $display) {
  $display
    ->setComponent($this
    ->getSourceFieldDefinition($type)
    ->getName(), [
    'type' => 'facebook_embed',
    'label' => 'visually_hidden',
  ]);
}