Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from shadlaws/master
#1931, #1932, #1933, #1934 - movieplayer view and movie_img function in items model
- Loading branch information
Showing
3 changed files
with
102 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,49 @@ | ||
<?php defined("SYSPATH") or die("No direct script access.") ?> | ||
<?= html::anchor($item->file_url(true), "", $attrs) ?> | ||
<?= html::anchor($url, "", $attrs) ?> | ||
<script type="text/javascript"> | ||
flowplayer( | ||
"<?= $attrs["id"] ?>", | ||
{ | ||
src: "<?= url::abs_file("lib/flowplayer.swf") ?>", | ||
wmode: "transparent", | ||
provider: "pseudostreaming" | ||
}, | ||
{ | ||
clip: { | ||
scaling: 'fit' | ||
}, | ||
plugins: { | ||
pseudostreaming: { | ||
url: "<?= url::abs_file("lib/flowplayer.pseudostreaming-byterange.swf") ?>" | ||
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.swf") ?>", | ||
"wmode": "transparent", | ||
"provider": "pseudostreaming" | ||
}, <?= json_encode($fp_params) ?>), | ||
$.extend(true, { | ||
"plugins": { | ||
"pseudostreaming": { | ||
"url": "<?= url::abs_file("lib/flowplayer.pseudostreaming-byterange.swf") ?>" | ||
}, | ||
controls: { | ||
autoHide: 'always', | ||
hideDelay: 2000 | ||
"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> |