diff options
| author | shadlaws <shad@shadlaws.com> | 2013-03-03 00:45:03 +0100 |
|---|---|---|
| committer | shadlaws <shad@shadlaws.com> | 2013-03-03 00:45:03 +0100 |
| commit | 9d7d6c50bb7713038231232f433ae28f6f117b95 (patch) | |
| tree | 58e3a892e5f10052bd62c079094505b5d6cb4bb2 /modules/gallery/views/movieplayer-flash.html.php | |
| parent | 384bc7afc86be706bf61def09afc8306cdad2443 (diff) | |
Follow-on to #2033 - Rename movieplayer.html.php to movieplayer-flash.html.php
- renamed file with "-flash" to make room for html5 player
- updated item model and xss_data.txt to reflect changes
--HG--
rename : modules/gallery/views/movieplayer.html.php => modules/gallery/views/movieplayer-flash.html.php
Diffstat (limited to 'modules/gallery/views/movieplayer-flash.html.php')
| -rw-r--r-- | modules/gallery/views/movieplayer-flash.html.php | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/modules/gallery/views/movieplayer-flash.html.php b/modules/gallery/views/movieplayer-flash.html.php new file mode 100644 index 00000000..6d3cee2a --- /dev/null +++ b/modules/gallery/views/movieplayer-flash.html.php @@ -0,0 +1,49 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<?= 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_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_config) ?>) + ).ipad(); + // set movie size using width and height passed from movie_img function + $("document").ready(set_movie_size(<?= $width ?>, <?= $height ?>)); +</script> |
