+
+ /**
+ * AJAX page which retrieves a video plugin.
+ *
+ * The view associated with this controller should be parameter type
+ * concatenated with '_plugin_view' and must be located in
+ * 'application/views/video'.
+ *
+ * @param string $type 'ns-vlc', 'ns-html5'
+ */
+ public function plugin($type)
+ {
+ $url = $this->input->post('url', TRUE);
+
+ $this->_plugin($type, $url);
+ }
+
+ /**
+ * Video plugin controller
+ *
+ * See plugin function for details. If the second parameter is TRUE
+ * the output is return instead of being displayed (used in preloading).
+ */
+ public function _plugin($type, $url, $return_output=FALSE)
+ {
+ if ($type == 'ns-html5')
+ $data['url'] = 'tribe://' . $url;
+ else if ($type == 'ns-vlc')
+ $data['url'] = $url;
+
+ $output = $this->load->view('video/'. $type . '_plugin_view', $data,
+ $return_output);
+
+ if ($return_output)
+ return $output;
+ }
+