You are here

public function BlazyVideoTrait::buildVideo in Blazy 8.2

Same name and namespace in other branches
  1. 8 src/Dejavu/BlazyVideoTrait.php \Drupal\blazy\Dejavu\BlazyVideoTrait::buildVideo()

Builds relevant Media settings based on the given media url.

@todo remove post Blazy 8.2.x full release. This is still kept to allow changing from video_embed_field into media field without breaking it, and to allow transition from blazy-related modules to depend on media. Currently this is only required by deprecated SlickVideoFormatter.

Parameters

array $settings: An array of settings to be passed into theme_blazy().

string $external_url: A video URL.

Deprecated

in blazy:8.x-2.0 and is removed from blazy:8.x-3.0. Use BlazyOEmbed::build() instead.

See also

https://www.drupal.org/node/3103018

File

src/Dejavu/BlazyVideoTrait.php, line 112

Class

BlazyVideoTrait
A Trait common for Media integration.

Namespace

Drupal\blazy\Dejavu

Code

public function buildVideo(array &$settings = [], $external_url = '') {
  @trigger_error('buildVideo is deprecated in blazy:8.x-2.0 and is removed from blazy:8.x-3.0. Use \\Drupal\\blazy\\BlazyOEmbed::build() instead. See https://www.drupal.org/node/3103018', E_USER_DEPRECATED);
  $settings['input_url'] = empty($settings['input_url']) ? $external_url : $settings['input_url'];
  return $this
    ->blazyOembed()
    ->build($settings);
}