Merge pull request #16840 from owncloud/fix-video-preview
Disable video preview if previews are disabled
This commit is contained in:
commit
b9c7b5575a
|
@ -214,6 +214,7 @@ class ShareController extends Controller {
|
||||||
|
|
||||||
$shareTmpl['downloadURL'] = $this->urlGenerator->linkToRouteAbsolute('files_sharing.sharecontroller.downloadShare', array('token' => $token));
|
$shareTmpl['downloadURL'] = $this->urlGenerator->linkToRouteAbsolute('files_sharing.sharecontroller.downloadShare', array('token' => $token));
|
||||||
$shareTmpl['maxSizeAnimateGif'] = $this->config->getSystemValue('max_filesize_animated_gifs_public_sharing', 10);
|
$shareTmpl['maxSizeAnimateGif'] = $this->config->getSystemValue('max_filesize_animated_gifs_public_sharing', 10);
|
||||||
|
$shareTmpl['previewEnabled'] = $this->config->getSystemValue('enable_previews', true);
|
||||||
|
|
||||||
$csp = new OCP\AppFramework\Http\ContentSecurityPolicy();
|
$csp = new OCP\AppFramework\Http\ContentSecurityPolicy();
|
||||||
$csp->addAllowedFrameDomain('\'self\'');
|
$csp->addAllowedFrameDomain('\'self\'');
|
||||||
|
|
|
@ -89,7 +89,7 @@ $thumbSize = 1024;
|
||||||
<?php if (isset($_['folder'])): ?>
|
<?php if (isset($_['folder'])): ?>
|
||||||
<?php print_unescaped($_['folder']); ?>
|
<?php print_unescaped($_['folder']); ?>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<?php if (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">
|
||||||
<source src="<?php p($_['downloadURL']); ?>" type="<?php p($_['mimetype']); ?>" />
|
<source src="<?php p($_['downloadURL']); ?>" type="<?php p($_['mimetype']); ?>" />
|
||||||
|
|
|
@ -178,6 +178,7 @@ class ShareControllerTest extends \Test\TestCase {
|
||||||
'nonHumanFileSize' => 33,
|
'nonHumanFileSize' => 33,
|
||||||
'maxSizeAnimateGif' => 10,
|
'maxSizeAnimateGif' => 10,
|
||||||
'previewSupported' => true,
|
'previewSupported' => true,
|
||||||
|
'previewEnabled' => true,
|
||||||
);
|
);
|
||||||
|
|
||||||
$csp = new \OCP\AppFramework\Http\ContentSecurityPolicy();
|
$csp = new \OCP\AppFramework\Http\ContentSecurityPolicy();
|
||||||
|
|
Loading…
Reference in New Issue