From baff63b70b2b686b14f468a26180081ad505ce9a Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 22 Feb 2009 05:21:44 +0000 Subject: Very basic movie support. You can upload a FLV file, we use ffmpeg to extract a thumbnail out of it and if you click through we show it using flowplayer. --- core/models/item.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'core/models') diff --git a/core/models/item.php b/core/models/item.php index e29f3245..da0e7eb3 100644 --- a/core/models/item.php +++ b/core/models/item.php @@ -84,6 +84,14 @@ class Item_Model extends ORM_MPTT { return $this->type == 'photo'; } + /** + * Is this item a movie? + * @return true if it's a movie + */ + public function is_movie() { + return $this->type == 'movie'; + } + public function delete() { $original_path = $this->file_path(); $original_resize_path = $this->resize_path(); @@ -308,7 +316,7 @@ class Item_Model extends ORM_MPTT { } /** - * Return an tag for the thumbnail. + * Return an tag for the resize. * @param array $extra_attrs Extra attributes to add to the img tag * @return string */ @@ -319,4 +327,15 @@ class Item_Model extends ORM_MPTT { "height" => $this->resize_height), $extra_attrs); } + + public function movie_tag($extra_attrs) { + return html::anchor($this->file_url(true), "", + array_merge( + $extra_attrs, + array("id" => "player", + "style" => "display:block;width:400px;height:300px"))) . + ""; + } } -- cgit v1.2.3