Fix: Bugs in shared link with video #24331
This commit is contained in:
parent
7c28f62e20
commit
53437ecced
|
@ -139,7 +139,7 @@ OCA.Sharing.PublicApp = {
|
||||||
}).then(function (data) {
|
}).then(function (data) {
|
||||||
self._showTextPreview(data, previewHeight);
|
self._showTextPreview(data, previewHeight);
|
||||||
});
|
});
|
||||||
} else if (previewSupported === 'true' ||
|
} else if ((previewSupported === 'true' && mimetype.substr(0, mimetype.indexOf('/')) !== 'video') ||
|
||||||
mimetype.substr(0, mimetype.indexOf('/')) === 'image' &&
|
mimetype.substr(0, mimetype.indexOf('/')) === 'image' &&
|
||||||
mimetype !== 'image/svg+xml') {
|
mimetype !== 'image/svg+xml') {
|
||||||
img.attr('src', OC.filePath('files_sharing', 'ajax', 'publicpreview.php') + '?' + OC.buildQueryString(params));
|
img.attr('src', OC.filePath('files_sharing', 'ajax', 'publicpreview.php') + '?' + OC.buildQueryString(params));
|
||||||
|
|
|
@ -21,11 +21,13 @@ OCP\Util::addScript('files', 'files');
|
||||||
OCP\Util::addScript('files', 'filelist');
|
OCP\Util::addScript('files', 'filelist');
|
||||||
OCP\Util::addscript('files', 'keyboardshortcuts');
|
OCP\Util::addscript('files', 'keyboardshortcuts');
|
||||||
|
|
||||||
$thumbSize = 1024;
|
$sysConfig = \OC::$server->getConfig();
|
||||||
|
$thumbSizeX = $sysConfig->getSystemValue('preview_max_x', 1024);
|
||||||
|
$thumbSizeY = $sysConfig->getSystemValue('preview_max_y', 1024);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php if ($_['previewSupported']): /* This enables preview images for links (e.g. on Facebook, Google+, ...)*/?>
|
<?php if ($_['previewSupported']): /* This enables preview images for links (e.g. on Facebook, Google+, ...)*/?>
|
||||||
<link rel="image_src" href="<?php p(\OC::$server->getURLGenerator()->linkToRoute( 'core_ajax_public_preview', array('x' => $thumbSize, 'y' => $thumbSize, 'file' => $_['directory_path'], 't' => $_['dirToken']))); ?>" />
|
<link rel="image_src" href="<?php p(\OC::$server->getURLGenerator()->linkToRoute( 'core_ajax_public_preview', array('x' => $thumbSizeX, 'y' => $thumbSizeY, 'file' => $_['directory_path'], 't' => $_['dirToken']))); ?>" />
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<div id="notification-container">
|
<div id="notification-container">
|
||||||
|
@ -94,7 +96,7 @@ $thumbSize = 1024;
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<?php if ($_['previewEnabled'] && substr($_['mimetype'], 0, strpos($_['mimetype'], '/')) == 'video'): ?>
|
<?php if ($_['previewEnabled'] && substr($_['mimetype'], 0, strpos($_['mimetype'], '/')) == 'video'): ?>
|
||||||
<div id="imgframe">
|
<div id="imgframe">
|
||||||
<video tabindex="0" controls="" preload="none">
|
<video tabindex="0" controls="" preload="none" style="max-width: <?php echo p($thumbSizeX); ?>px; max-height: <?php p($thumbSizeY); ?>px">
|
||||||
<source src="<?php p($_['downloadURL']); ?>" type="<?php p($_['mimetype']); ?>" />
|
<source src="<?php p($_['downloadURL']); ?>" type="<?php p($_['mimetype']); ?>" />
|
||||||
</video>
|
</video>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue