1
0
This repository has been archived on 2021-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
gallery3-contrib/3.0/modules/transcode/views/transcode_resolution_variants.html.php
2010-11-22 21:33:50 +00:00

30 lines
1.4 KiB
PHP

<?php defined("SYSPATH") or die("No direct script access.") ?>
<?php if ($item->is_movie()): ?>
<?php if (count($resolutions) > 0): ?>
<select id="resolution-select" onchange="changeVideo(this.value);">
<?php foreach ($resolutions as $resolution): ?>
<?php $r = explode("x", $resolution->resolution); ?>
<option value="<?php echo $resolution->resolution; ?>"><?php echo $r[0]; ?> x <?php echo $r[1]; ?></option>
<?php endforeach; ?>
</select>
<script type="text/javascript">
var fpItmId = "g-item-id-<?php echo $item->id; ?>";
var fpBaseUrl = "<?php echo url::abs_file("var/modules/transcode/flv/" . $item->id); ?>/";
$f(fpItmId).onLoad(function() {
changeVideo($('#resolution-select').val());
//var url = fpBaseUrl + $('#resolution-select').val() + ".flv";
//$('#' + fpItmId).flowplayer(0).play(url);
});
function changeVideo(res) {
var id = "g-item-id-<?php echo $item->id; ?>";
var dim = res.split('x');
$('#' + fpItmId).css({width: dim[0] + 'px', height: dim[1] + 'px'});
$('#' + id).flowplayer(0).play(fpBaseUrl + res + ".flv");
}
</script>
<?php else: ?>
<p>No alternative resolutions available.</p>
<?php endif; ?>
<?php endif; ?>