plugin detection created as a widget; can't tell yet if swarmplayer is installed
[living-lab-site.git] / application / controllers / video.php
index 0003f74..019fa2c 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * Class Video controlls video items handling: watching, commenting, rating,
+ * Class Video controls video items handling: watching, commenting, rating,
  * adding etc.
  *
  * @category   Controller
@@ -33,6 +33,9 @@ class Video extends CI_Controller {
        {
                $this->load->helper('url');
                
+               // **
+               // ** LOADING MODEL
+               // **
                // Retrieve video information.
                $this->load->model('videos_model');
                $data['video'] = $this->videos_model->get_video($id, $name);
@@ -41,19 +44,34 @@ class Video extends CI_Controller {
                // Display page.
                $params = array(        'title' => $data['video']['title'] . ' -- '
                                                                . $this->config->item('site_name'),
-                                                       'css' => array('jquery-ui.css', 'NextShare_VLC_plugin.css'),
-                                                       'js' => array('jquery.min.js', 'jquery-ui.min.js', 'NextShare_VLC_plugin.js', 'video.js'),
+                                                       'css' => array(
+                                                               'jquery.ui.nsvideo.css',
+                                                               'video.css'
+                                                       ),
+                                                       'js' => array(
+                                                               'jquery.ui.nsvideo.js'
+                                                       ),
                                                        //'metas' => array('description'=>'','keywords'=>'')
                                                        );
                $this->load->library('html_head_params', $params);
-               $this->load->view('html_begin', $this->html_head_params);
-               $this->load->view('header');
                
                // Preloading video plugin.
-               // TODO plugin auto (type + definition)
-               $data['plugin_content'] = $this->_plugin('ns-html5', 
-                       $data['video']['url'][0], TRUE);
+               // TODO plugin auto: type and format
+               if ($data['plugin_type'] == 'auto')
+                       $data['plugin_type'] = 'ns-html5';
+               $data['asset_index'] = 0;
+               
+               // TODO remove old AJAX plugin content
+//             $data['plugin_content'] = $this->_plugin('ns-html5', 
+//                     $data['video']['url'][0], TRUE);
+               
+               // **
+               // ** LOADING VIEWS
+               // **
+               $this->load->view('html_begin', $this->html_head_params);
+               $this->load->view('header');
                
+               //$main_params['content'] = $this->load->view('video/watch_view', $data, TRUE);
                $this->load->view('video/watch_view', $data);
                
                $this->load->view('footer');