video poster
This commit is contained in:
parent
53437ecced
commit
11b2e98a30
|
@ -149,6 +149,9 @@ OCA.Sharing.PublicApp = {
|
||||||
img.attr('width', 128);
|
img.attr('width', 128);
|
||||||
img.appendTo('#imgframe');
|
img.appendTo('#imgframe');
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
$('#imgframe > video').attr('poster', OC.filePath('files_sharing', 'ajax', 'publicpreview.php') + '?' + OC.buildQueryString(params));
|
||||||
|
}
|
||||||
|
|
||||||
if (this.fileList) {
|
if (this.fileList) {
|
||||||
// TODO: move this to a separate PublicFileList class that extends OCA.Files.FileList (+ unit tests)
|
// TODO: move this to a separate PublicFileList class that extends OCA.Files.FileList (+ unit tests)
|
||||||
|
|
|
@ -347,6 +347,8 @@ 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);
|
$shareTmpl['previewEnabled'] = $this->config->getSystemValue('enable_previews', true);
|
||||||
|
$shareTmpl['previewMaxX'] = $this->config->getSystemValue('preview_max_x', 1024);
|
||||||
|
$shareTmpl['previewMaxY'] = $this->config->getSystemValue('preview_max_y', 1024);
|
||||||
|
|
||||||
$csp = new OCP\AppFramework\Http\ContentSecurityPolicy();
|
$csp = new OCP\AppFramework\Http\ContentSecurityPolicy();
|
||||||
$csp->addAllowedFrameDomain('\'self\'');
|
$csp->addAllowedFrameDomain('\'self\'');
|
||||||
|
|
|
@ -20,14 +20,10 @@ OCP\Util::addScript('files', 'newfilemenu');
|
||||||
OCP\Util::addScript('files', 'files');
|
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');
|
||||||
|
|
||||||
$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' => $thumbSizeX, 'y' => $thumbSizeY, 'file' => $_['directory_path'], 't' => $_['dirToken']))); ?>" />
|
<link rel="image_src" href="<?php p(\OC::$server->getURLGenerator()->linkToRoute( 'core_ajax_public_preview', array('x' => $_['previewMaxX'], 'y' => $_['previewMaxY'], 'file' => $_['directory_path'], 't' => $_['dirToken']))); ?>" />
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<div id="notification-container">
|
<div id="notification-container">
|
||||||
|
@ -96,7 +92,7 @@ $thumbSizeY = $sysConfig->getSystemValue('preview_max_y', 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" style="max-width: <?php echo p($thumbSizeX); ?>px; max-height: <?php p($thumbSizeY); ?>px">
|
<video tabindex="0" controls="" preload="none" style="max-width: <?php p($_['previewMaxX']); ?>px; max-height: <?php p($_['previewMaxY']); ?>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