Merge pull request #16840 from owncloud/fix-video-preview

Disable video preview if previews are disabled
This commit is contained in:
Lukas Reschke 2015-06-09 22:32:13 +02:00
commit b9c7b5575a
3 changed files with 3 additions and 1 deletions

View File

@ -214,6 +214,7 @@ class ShareController extends Controller {
$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['previewEnabled'] = $this->config->getSystemValue('enable_previews', true);
$csp = new OCP\AppFramework\Http\ContentSecurityPolicy();
$csp->addAllowedFrameDomain('\'self\'');

View File

@ -89,7 +89,7 @@ $thumbSize = 1024;
<?php if (isset($_['folder'])): ?>
<?php print_unescaped($_['folder']); ?>
<?php else: ?>
<?php if (substr($_['mimetype'], 0, strpos($_['mimetype'], '/')) == 'video'): ?>
<?php if ($_['previewEnabled'] && substr($_['mimetype'], 0, strpos($_['mimetype'], '/')) == 'video'): ?>
<div id="imgframe">
<video tabindex="0" controls="" preload="none">
<source src="<?php p($_['downloadURL']); ?>" type="<?php p($_['mimetype']); ?>" />

View File

@ -178,6 +178,7 @@ class ShareControllerTest extends \Test\TestCase {
'nonHumanFileSize' => 33,
'maxSizeAnimateGif' => 10,
'previewSupported' => true,
'previewEnabled' => true,
);
$csp = new \OCP\AppFramework\Http\ContentSecurityPolicy();