You are here

public function PHPVideoToolkit::fileHasVideo in Video 7.2

Same name and namespace in other branches
  1. 7 libraries/phpvideotoolkit/phpvideotoolkit.php5.php \PHPVideoToolkit::fileHasVideo()

Determines if the input media has a video stream.

@access public

Parameters

string $file The absolute path of the file that is required to be manipulated.:

Return value

bool

File

libraries/phpvideotoolkit/phpvideotoolkit.php5.php, line 1097
Libary to access FFmpeg

Class

PHPVideoToolkit

Code

public function fileHasVideo($file = FALSE) {

  // 			check to see if this is a static call
  if ($file !== FALSE && isset($this) === FALSE) {
    $toolkit = new PHPVideoToolkit();
    $data = $toolkit
      ->getFileInfo($file);
  }
  elseif ($file === FALSE) {
    if (!$this->_input_file) {

      //					input file not valid
      return $this
        ->_raiseError('inputFileHasVideo_no_input');

      // <-				exits
    }
    $file = $this->_input_file;
    $data = $this
      ->getFileInfo($file);
  }
  return isset($data['video']);
}