You are here

public function video_metadata::__construct in Video 6.4

Same name and namespace in other branches
  1. 7 includes/metadata.inc \video_metadata::__construct()
1 method overrides video_metadata::__construct()
flvtool2::__construct in metadata/flvtool2.inc

File

includes/metadata.inc, line 13

Class

video_metadata

Code

public function __construct($metadata = null) {

  //get our configured transcoder.
  if (!isset($metadata)) {
    $metadata = variable_get('vid_metadata', 'flvtool2');
  }
  if (!module_load_include('inc', 'video', '/metadata/' . $metadata)) {
    $modules = module_list();
    foreach ($modules as $module) {
      $mobule_files = array();
      $module_path = drupal_get_path('module', $module) . '/metadata';
      $mobule_files = file_scan_directory($module_path, '^.*\\.inc$');
      if (is_array($mobule_files)) {
        foreach ($mobule_files as $file) {
          if ($file->name == $metadata) {
            require_once $file->filename;
          }
        }
      }

      //
    }
  }
  if (class_exists($metadata)) {
    $this->metadata = new $metadata();
  }
  else {
    drupal_set_message(t('The metadata is not configured properly.'), 'error');
  }
}