4 * Class Video controlls video items handling: watching, commenting, rating,
8 * @author Călin-Andrei Burloiu
10 class Video extends CI_Controller {
12 public function __construct()
14 parent::__construct();
17 public function index()
23 * The page used for watching a video
25 * @param string $id DB id of the video
26 * @param string $name `name` of the video from DB
27 * @param string $plugin video plugin ('ns-vlc', 'ns-html5'). If it's set
28 * to NULL or 'auto', the plugin is automatically selected.
30 public function watch($id, $name = NULL, $plugin = NULL)
32 $this->load->helper('url');
34 // Retrieve video information.
35 $this->load->model('videos_model');
36 $data['video'] = $this->videos_model->get_video($id, $name);
37 $data['plugin'] = ($plugin === NULL ? 'auto' : $plugin);
40 $params = array( 'title' => $data['video']['title'] . ' -- '
41 . $this->config->item('site_name'),
42 'css' => array('jquery-ui.css', 'NextShare_VLC_plugin.css'),
43 'js' => array('jquery.min.js', 'jquery-ui.min.js', 'NextShare_VLC_plugin.js', 'video.js'),
44 //'metas' => array('description'=>'','keywords'=>'')
46 $this->load->library('html_head_params', $params);
47 $this->load->view('html_begin', $this->html_head_params);
48 $this->load->view('header');
50 $this->load->view('video/watch_view', $data);
52 $this->load->view('footer');
53 $this->load->view('html_end');
57 * AJAX page which retrieves a video plugin.
59 * The view associated with this controller should be parameter type
60 * concatenated with '_plugin_view' and must be located in
61 * 'application/views/video'.
63 * @param string $type 'ns-vlc', 'ns-html5'
65 public function plugin($type)
67 $data['url'] = $this->input->post('url', TRUE);
69 $this->load->view('video/'. $type . '_plugin_view', $data);
73 /* End of file video.php */
74 /* Location: ./application/controllers/video.php */