You are here

public function BackgroundVideoManager::_background_video_geturl_preprocess_page in Background Video 8

1 call to BackgroundVideoManager::_background_video_geturl_preprocess_page()
BackgroundVideoManager::getJsSettings in src/Manager/BackgroundVideoManager.php
Returns JS settings.

File

src/Manager/BackgroundVideoManager.php, line 39

Class

BackgroundVideoManager
Class BackgroundVideoManager

Namespace

Drupal\background_video\Manager

Code

public function _background_video_geturl_preprocess_page($type) {
  $fid = $this->config
    ->get('background_video_source_' . $type)[0];
  if (!empty($fid)) {
    $file = File::load($fid);
    if ($file) {
      return file_create_url($file
        ->toArray()['uri'][0]['value']);
    }
  }
}