summaryrefslogtreecommitdiffstats
path: root/lib/class/video.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/class/video.class.php')
-rw-r--r--lib/class/video.class.php150
1 files changed, 75 insertions, 75 deletions
diff --git a/lib/class/video.class.php b/lib/class/video.class.php
index 5a758aae..8299cf8d 100644
--- a/lib/class/video.class.php
+++ b/lib/class/video.class.php
@@ -1,5 +1,5 @@
<?php
-/* vim:set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab: */
+/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
/**
*
* LICENSE: GNU General Public License, version 2 (GPLv2)
@@ -22,107 +22,107 @@
class Video extends database_object implements media {
- public $id;
- public $title;
- public $enabled;
- public $file;
- public $size;
+ public $id;
+ public $title;
+ public $enabled;
+ public $file;
+ public $size;
- /**
- * Constructor
- * This pulls the shoutbox information from the database and returns
- * a constructed object, uses user_shout table
- */
- public function __construct($id) {
+ /**
+ * Constructor
+ * This pulls the shoutbox information from the database and returns
+ * a constructed object, uses user_shout table
+ */
+ public function __construct($id) {
- // Load the data from the database
- $info = $this->get_info($id);
- foreach ($info as $key=>$value) {
- $this->$key = $value;
- }
+ // Load the data from the database
+ $info = $this->get_info($id);
+ foreach ($info as $key=>$value) {
+ $this->$key = $value;
+ }
- return true;
+ return true;
- } // Constructor
+ } // Constructor
- /**
- * build_cache
- * Build a cache based on the array of ids passed, saves lots of little queries
- */
- public static function build_cache($ids=array()) {
+ /**
+ * build_cache
+ * Build a cache based on the array of ids passed, saves lots of little queries
+ */
+ public static function build_cache($ids=array()) {
- if (!is_array($ids) OR !count($ids)) { return false; }
+ if (!is_array($ids) OR !count($ids)) { return false; }
- $idlist = '(' . implode(',',$ids) . ')';
+ $idlist = '(' . implode(',',$ids) . ')';
- $sql = "SELECT * FROM `video` WHERE `video`.`id` IN $idlist";
- $db_results = Dba::read($sql);
+ $sql = "SELECT * FROM `video` WHERE `video`.`id` IN $idlist";
+ $db_results = Dba::read($sql);
- while ($row = Dba::fetch_assoc($db_results)) {
- parent::add_to_cache('video',$row['id'],$row);
- }
+ while ($row = Dba::fetch_assoc($db_results)) {
+ parent::add_to_cache('video',$row['id'],$row);
+ }
- } // build_cache
+ } // build_cache
- /**
- * format
- * This formats a video object so that it is human readable
- */
- public function format() {
+ /**
+ * format
+ * This formats a video object so that it is human readable
+ */
+ public function format() {
- $this->f_title = scrub_out($this->title);
- $this->f_link = scrub_out($this->title);
- $this->f_codec = $this->video_codec . ' / ' . $this->audio_codec;
- $this->f_resolution = $this->resolution_x . 'x' . $this->resolution_y;
- $this->f_tags = '';
- $this->f_length = floor($this->time/60) . ' ' . T_('minutes');
+ $this->f_title = scrub_out($this->title);
+ $this->f_link = scrub_out($this->title);
+ $this->f_codec = $this->video_codec . ' / ' . $this->audio_codec;
+ $this->f_resolution = $this->resolution_x . 'x' . $this->resolution_y;
+ $this->f_tags = '';
+ $this->f_length = floor($this->time/60) . ' ' . T_('minutes');
- } // format
+ } // format
- public function get_stream_types() {
+ public function get_stream_types() {
- return array('native');
+ return array('native');
- } // native_stream
+ } // native_stream
- /**
- * play_url
- * This returns a "PLAY" url for the video in question here, this currently feels a little
- * like a hack, might need to adjust it in the future
- */
- public static function play_url($oid,$sid='',$force_http='') {
+ /**
+ * play_url
+ * This returns a "PLAY" url for the video in question here, this currently feels a little
+ * like a hack, might need to adjust it in the future
+ */
+ public static function play_url($oid,$sid='',$force_http='') {
- $video = new Video($oid);
+ $video = new Video($oid);
- if (!$video->id) { return false; }
+ if (!$video->id) { return false; }
- $uid = intval($GLOBALS['user']->id);
- $oid = intval($video->id);
+ $uid = intval($GLOBALS['user']->id);
+ $oid = intval($video->id);
- $url = Stream::get_base_url() . "video=true&uid=$uid&oid=$oid";
+ $url = Stream::get_base_url() . "video=true&uid=$uid&oid=$oid";
- return $url;
+ return $url;
- } // play_url
+ } // play_url
- /**
- * get_transcode_settings
- *
- * FIXME: Video transcoding is not implemented
- */
- public function get_transcode_settings($target = null) {
- return false;
- }
+ /**
+ * get_transcode_settings
+ *
+ * FIXME: Video transcoding is not implemented
+ */
+ public function get_transcode_settings($target = null) {
+ return false;
+ }
- /**
- * has_flag
- * returns true if the video has been flagged and we shouldn't try to re-read
- * the meta data
- */
- public function has_flag() {
+ /**
+ * has_flag
+ * returns true if the video has been flagged and we shouldn't try to re-read
+ * the meta data
+ */
+ public function has_flag() {
- } // has_flag
+ } // has_flag
} // end Video class