- $data['video'] = $this->videos_model->getVideo($id)->row();
- if ($name !== NULL && $data['video']->name != $name)
- $data['video']->err = 'INVALID_NAME';
+ $data['video'] = $this->videos_model->get_video($id, $name);
+ $data['plugin_type'] = ($plugin === NULL ? 'auto' : $plugin);
+
+ // Display page.
+ $params = array( 'title' => $data['video']['title'] . ' -- '
+ . $this->config->item('site_name'),
+ '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);
+
+ // Preloading video plugin.
+ // 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');