This commit is contained in:
chaideqing
2023-11-16 03:01:39 +00:00
parent 0aa2e7b91a
commit a28958a8b4
+13 -1
View File
@@ -23,7 +23,7 @@
<div id='imageFile'><?php echo html::image($this->createLink('file', 'read', "fileID=$file->id"));?></div>
<?php elseif($fileType == 'video'):?>
<div id='videoFile'>
<video src=<?php echo $file->webPath;?> autoplay controls controlsList='nodownload' onerror='showError()'></video>
<video src=<?php echo $file->webPath;?> autoplay controls controlsList='nodownload' onerror='showError()' onloadedmetadata='loadedmetadata()'></video>
<div class='playfailed hide'><?php echo $lang->file->playFailed;?></div>
</div>
<?php else:?>
@@ -62,6 +62,18 @@ function showError()
$('.playfailed').show();
}
function loadedmetadata()
{
var videoElem = $('video')[0];
var metaHeight = videoElem.videoHeight;
var parentHeight = window.parent.innerHeight;
var videoMaxHeight = parentHeight - 190;
if(videoMaxHeight < metaHeight)
{
$(videoElem).css('height', videoMaxHeight);
}
}
function setCharset(charset)
{
var link = createLink('file', 'download', 'fileID=' + fileID + '&mouse=left');