public function BootstrapLayout::buildBackgroundMediaLocalVideo in Bootstrap Layout Builder 1.x
Helper function to the background media local video style.
Parameters
object $media_entity: A media entity object.
object $field_name: The Media entity local video field name.
Return value
string Background media local video style.
1 call to BootstrapLayout::buildBackgroundMediaLocalVideo()
- BootstrapLayout::build in src/
Plugin/ Layout/ BootstrapLayout.php - Build a render array for layout with regions.
File
- src/
Plugin/ Layout/ BootstrapLayout.php, line 212
Class
- BootstrapLayout
- A layout from our bootstrap layout builder.
Namespace
Drupal\bootstrap_layout_builder\Plugin\LayoutCode
public function buildBackgroundMediaLocalVideo($media_entity, $field_name) {
$fid = $media_entity
->get($field_name)->target_id;
$file = File::load($fid);
return $file
->createFileUrl();
}