* @package WB * @subpackage VFS */ WBClass::load('WBEvent_Handler' , 'WBEvent_Handler_VFS'); /** * Event_Handler_VFS: Transcoder * * * * @version 0.1.0 * @package WB * @subpackage VFS */ class WBEvent_Handler_VFS_Transcoder extends WBEvent_Handler_VFS { /** * Handler Config * * Parameters: * @var array */ protected $config = array( ); /** * Transcoder VFS File * * @see isRecoverable() * @param WBEvent $e * @return bool true to continue, false to stop processing * @throws Exception in case of error */ public function process(WBEvent $e) { $id = $e->get('id'); $mimemajor = $e->get('mimemajor'); echo __CLASS__ . ':' . $id . ':'. $mimemajor . "\n"; if ('video' != $mimemajor) { return true; } $this->file = $this->file->loadById($id); if (!$this->file->isOK()) { echo "could not load file\n"; return true; } return $this->transcodeVideo(); } private function transcodeVideo() { $this->mime = WBClass::create('WBVFS_Mime_Video'); $fd = $this->file->get(); echo '
' . print_r($fd, true) . '
' . "\n"; sleep(1); return true; } }