diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index 430119b5a9..5103707395 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -492,14 +492,13 @@ public function resize_img($extra_attrs) { * @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) . - ""; + $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 0000000000..e8cabd31a1 --- /dev/null +++ b/modules/gallery/views/movieplayer.html.php @@ -0,0 +1,15 @@ + +file_url(true), "", $attrs) ?> + diff --git a/themes/default/views/movie.html.php b/themes/default/views/movie.html.php index 134e3571ee..c2fb0e3073 100644 --- a/themes/default/views/movie.html.php +++ b/themes/default/views/movie.html.php @@ -12,23 +12,7 @@ - - - + movie_img(array("class" => "gMovie", "id" => "gMovieId-{$item->id}")) ?>

title) ?>