You are here

public function Media23VideoInternetHandler::getFileObject in Media 23video 7

Returns a file object which can be used for validation.

Return value

\stdClass Drupal file object.

See also

MediaInternetBaseHandler::getFileObject()

File

includes/Media23VideoInternetHandler.inc, line 78
Definition of Media23VideoInternetHandler object.

Class

Media23VideoInternetHandler
Class Media23VideoInternetHandler.

Code

public function getFileObject() {
  $file = file_uri_to_object($this
    ->parse($this->embedCode), TRUE);
  if (empty($file->fid)) {
    $info = $this
      ->getOEmbed();
    if (!empty($info['title'])) {
      $file->filename = truncate_utf8($info['title'], 255);
    }
  }
  return $file;
}