From 8aec78258bdaa522a1a31d1750114cacff4b8b51 Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Thu, 19 Sep 2013 09:10:57 -0400 Subject: [PATCH] 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. --- web/app/Controller/EventsController.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/web/app/Controller/EventsController.php b/web/app/Controller/EventsController.php index 50fb864ea..acd06c95d 100644 --- a/web/app/Controller/EventsController.php +++ b/web/app/Controller/EventsController.php @@ -58,6 +58,14 @@ public function index() { throw new NotFoundException(__('Invalid 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) {