コード例 #1
0
 /**
  * Returns the raw data provided by ffmpeg about a file.
  *
  * @access public
  * @author Oliver Lillie
  * @param boolean $read_from_cache 
  * @return mixed Returns false if no data is returned, otherwise returns the raw data as a string.
  */
 public function readRawInformation($read_from_cache = true)
 {
     return parent::getFileRawInformation($this->_media_file_path, $read_from_cache);
 }
コード例 #2
0
 /**
  * Attempts to read the data about the file given by $path and then returns the class
  * name of the related media object.
  *
  * @access protected
  * @author Oliver Lillie
  * @param string $path The file pathe of the file to find the media class for.
  * @return string Returns the class name of the PHPVideoToolkit class related to the given $path argument.
  */
 protected function _findMediaClass($path)
 {
     //          read the output to determine what it is so it can be post processed.
     $data = getimagesize($path);
     if (!$data) {
         $media_parser = new MediaParser($this->_config);
         $type = $media_parser->getFileType($path);
     } else {
         if (strpos($data['mime'], 'image/') !== false) {
             $type = 'image';
         } else {
             $type = 'video';
         }
     }
     //          now we have the information switch between the types and create the return object.
     $class = 'Media';
     switch ($type) {
         case 'audio':
         case 'video':
         case 'image':
             $class = '\\PHPVideoToolkit\\' . ucfirst(strtolower($type));
             break;
     }
     return $class;
 }