You are here

public function Html5::__construct in Video Embed HTML5 8

Html5 constructor.

Parameters

string $configuration:

string $plugin_id:

array $plugin_definition:

\GuzzleHttp\ClientInterface $http_client:

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler:

\Drupal\Core\File\FileSystemInterface $file_system:

\Drupal\Core\Config\ConfigFactoryInterface $config_factory:

File

src/Plugin/video_embed_field/Provider/Html5.php, line 46

Class

Html5
A Html5 provider plugin.

Namespace

Drupal\video_embed_html5\Plugin\video_embed_field\Provider

Code

public function __construct($configuration, $plugin_id, array $plugin_definition, ClientInterface $http_client, ModuleHandlerInterface $module_handler, FileSystemInterface $file_system, ConfigFactoryInterface $config_factory) {
  parent::__construct($configuration, $plugin_id, $plugin_definition, $http_client);
  $this->phpFFMpeg = FALSE;
  if ($module_handler
    ->moduleExists('php_ffmpeg')) {
    $this->phpFFMpeg = \Drupal::service('php_ffmpeg');
  }
  $this->fileSystem = $file_system;
  $this->config = $config_factory
    ->get('video_embed_html5.config');

  // Set filename for thumbnail.
  list($video_url, $video_type) = $this
    ->getVideoId();
  $this->videoUrl = $video_url;
  $this->videoType = $video_type;
  $this->filename = md5($video_url);
}