summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-06-30 08:21:00 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-06-30 08:21:00 -0700
commit8ed6d1183b50de62d495361ff37be71fcc00d48b (patch)
tree71941d913da77a09321a4d3bdf72f9b59bbd9b3a /modules
parent4943103700332a11f16319496e485cfd7fd9e36a (diff)
Fix for #319.
Created a new view "movieplayer.html.php", which is rendered by Item_Model::movie_img(). Changed movie.html.php to use movie_img to render the movie player link.
Diffstat (limited to 'modules')
-rw-r--r--modules/gallery/models/item.php15
-rw-r--r--modules/gallery/views/movieplayer.html.php15
2 files changed, 22 insertions, 8 deletions
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php
index 430119b5..51037073 100644
--- a/modules/gallery/models/item.php
+++ b/modules/gallery/models/item.php
@@ -492,14 +492,13 @@ class Item_Model extends ORM_MPTT {
* @return string
*/
public function movie_img($extra_attrs) {
- $attrs = array_merge($extra_attrs,
- array("id" => "player",
- "style" => "display:block;width:400px;height:300px")
- );
- return html::anchor($this->file_url(true), "", $attrs) .
- "<script>flowplayer('player', '" .
- url::abs_file("lib/flowplayer-3.0.5.swf") .
- "'); </script>";
+ $v = new View("movieplayer.html");
+ $v->attrs = array_merge($extra_attrs,
+ array("style" => "display:block;width:{$this->width}px;height:{$this->height}px"));
+ if (empty($v->attrs["id"])) {
+ $v->attrs["id"] = "gMovieId-{$this->id}";
+ }
+ return $v;
}
/**
diff --git a/modules/gallery/views/movieplayer.html.php b/modules/gallery/views/movieplayer.html.php
new file mode 100644
index 00000000..e8cabd31
--- /dev/null
+++ b/modules/gallery/views/movieplayer.html.php
@@ -0,0 +1,15 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<?= html::anchor($item->file_url(true), "", $attrs) ?>
+<script>
+ flowplayer("<?= $attrs["id"] ?>", "<?= url::abs_file("lib/flowplayer.swf") ?>", {
+ plugins: {
+ h264streaming: {
+ url: "<?= url::abs_file("lib/flowplayer.h264streaming.swf") ?>"
+ },
+ controls: {
+ autoHide: 'always',
+ hideDelay: 2000
+ }
+ }
+ })
+</script>