mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-03 19:49:09 -04:00
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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
15
modules/gallery/views/movieplayer.html.php
Normal file
15
modules/gallery/views/movieplayer.html.php
Normal file
@@ -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>
|
||||
@@ -12,23 +12,7 @@
|
||||
<? endif ?>
|
||||
</ul>
|
||||
|
||||
<a id="gMovieId-<?= $item->id ?>"
|
||||
href="<?= $item->file_url(true) ?>"
|
||||
style="display: block; width: <?= $item->width ?>px; height: <?= $item->height ?>px">
|
||||
</a>
|
||||
<script>
|
||||
flowplayer("gMovieId-<?= $item->id ?>", "<?= url::abs_file("lib/flowplayer.swf") ?>", {
|
||||
plugins: {
|
||||
h264streaming: {
|
||||
url: "<?= url::abs_file("lib/flowplayer.h264streaming.swf") ?>"
|
||||
},
|
||||
controls: {
|
||||
autoHide: 'always',
|
||||
hideDelay: 2000
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<?= $item->movie_img(array("class" => "gMovie", "id" => "gMovieId-{$item->id}")) ?>
|
||||
|
||||
<div id="gInfo">
|
||||
<h1><?= p::clean($item->title) ?></h1>
|
||||
|
||||
Reference in New Issue
Block a user