diff options
author | shadlaws <shad@shadlaws.com> | 2013-03-09 12:51:45 +0100 |
---|---|---|
committer | shadlaws <shad@shadlaws.com> | 2013-03-09 12:51:45 +0100 |
commit | 18f38f0dff93665267bd1497b196d9270fdbdc88 (patch) | |
tree | f2918bc61f794896ab197d31e5a8f9202aa452d8 /modules/gallery/views | |
parent | 566572809679ee5a266717cee1ed922ce4161814 (diff) |
#2046 - Change Gallery over to using MediaElementJS as its movie player.
Diffstat (limited to 'modules/gallery/views')
-rw-r--r-- | modules/gallery/views/movieplayer-flash.html.php | 50 | ||||
-rw-r--r-- | modules/gallery/views/movieplayer.html.php | 17 |
2 files changed, 17 insertions, 50 deletions
diff --git a/modules/gallery/views/movieplayer-flash.html.php b/modules/gallery/views/movieplayer-flash.html.php deleted file mode 100644 index 12303bf4..00000000 --- a/modules/gallery/views/movieplayer-flash.html.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php defined("SYSPATH") or die("No direct script access.") ?> -<script type="text/javascript" src="<?= url::file("lib/flowplayer-flash/flowplayer.js") ?>"></script> -<?= html::anchor($url, "", $attrs) ?> -<script type="text/javascript"> - var id = "<?= $attrs["id"] ?>"; - var max_size = <?= $max_size ?>; - // set the size of the movie html anchor, taking into account max_size and height of control bar - function set_movie_size(width, height) { - if((width > max_size) || (height > max_size)) { - if (width > height) { - height = Math.ceil(height * max_size / width); - width = max_size; - } else { - width = Math.ceil(width * max_size / height); - height = max_size; - } - } - height += flowplayer(id).getConfig().plugins.controls.height; - $("#" + id).css({width: width, height: height}); - }; - // setup flowplayer - flowplayer(id, - $.extend(true, { - "src": "<?= url::abs_file("lib/flowplayer-flash/flowplayer.swf") ?>", - "wmode": "transparent", - "provider": "pseudostreaming" - }, <?= json_encode($fp_flash_params) ?>), - $.extend(true, { - "plugins": { - "pseudostreaming": { - "url": "<?= url::abs_file("lib/flowplayer-flash/flowplayer.pseudostreaming-byterange.swf") ?>" - }, - "controls": { - "autoHide": "always", - "hideDelay": 2000, - "height": 24 - } - }, - "clip": { - "scaling": "fit", - "onMetaData": function(clip) { - // set movie size a second time using actual size from metadata - set_movie_size(parseInt(clip.metaData.width), parseInt(clip.metaData.height)); - } - } - }, <?= json_encode($fp_flash_config) ?>) - ).ipad(); - // set movie size using width and height passed from movie_img function - $("document").ready(set_movie_size(<?= $width ?>, <?= $height ?>)); -</script> diff --git a/modules/gallery/views/movieplayer.html.php b/modules/gallery/views/movieplayer.html.php new file mode 100644 index 00000000..f78cc91a --- /dev/null +++ b/modules/gallery/views/movieplayer.html.php @@ -0,0 +1,17 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<div <?= html::attributes($div_attrs) ?>> + <video <?= html::attributes($video_attrs) ?>> + <source <?= html::attributes($source_attrs) ?>> + </video> +</div> +<script type="text/javascript"> + $("#<?= $div_attrs["id"] ?> video").mediaelementplayer( + $.extend(true, { + defaultVideoWidth: <?= $width ?>, + defaultVideoHeight: <?= $height ?>, + startVolume: 1.0, + features: ["playpause", "progress", "current", "duration", "volume", "fullscreen"], + pluginPath: "<?= url::abs_file("lib/mediaelementjs/") ?>" + }, <?= json_encode($player_options) ?>) + ); +</script> |