Create a video for each event view.

This determines the appropriate video format based on the user agent,
creates the video, and then returns the video path to the view.
This commit is contained in:
Kyle Johnson 2013-09-19 09:10:57 -04:00
parent 5844a1cc89
commit 8aec78258b
1 changed files with 8 additions and 0 deletions

View File

@ -58,6 +58,14 @@ public function index() {
throw new NotFoundException(__('Invalid event')); throw new NotFoundException(__('Invalid event'));
} }
$this->set('event', $event); $this->set('event', $event);
if (!strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
$videoFormat = 'webm';
} else {
$videoFormat = 'mp4';
}
$this->set('videoSrc', $this->Event->createVideo( $id, $videoFormat, 100, 100 ));
} }
public function delete($id) { public function delete($id) {