From 53fdcf33bce5d308f7935b38fa7ef6ab6aab438c Mon Sep 17 00:00:00 2001 From: Florian BLOUET Date: Mon, 14 Dec 2015 15:21:28 +0100 Subject: [PATCH] add autoplay option for caption preview, removed useless audio and video libs --- .../Controller/Prod/TooltipController.php | 1 + templates/web/common/preview.html.twig | 8 +- templates/web/common/thumbnail.html.twig | 8 +- .../FlexPaper_flash/FlexPaperViewer.swf | Bin 302173 -> 0 bytes .../audio-player/audio-player-noswfobject.js | 1 - .../audio-player/audio-player-uncompressed.js | 109 --- .../jslibs/audio-player/audio-player.js | 5 - www/include/jslibs/audio-player/license.txt | 19 - www/include/jslibs/audio-player/player.swf | Bin 10816 -> 0 bytes www/include/jslibs/flowplayer/LICENSE.txt | 721 ------------------ www/include/jslibs/flowplayer/README.txt | 504 ------------ .../flowplayer/flowplayer-3.2.13.min.js | 22 - .../jslibs/flowplayer/flowplayer-3.2.18.swf | Bin 129772 -> 0 bytes .../flowplayer/flowplayer.controls-3.2.16.swf | Bin 38270 -> 0 bytes .../flowplayer/pseudostreaming/LICENSE.txt | 22 - .../flowplayer/pseudostreaming/README.txt | 130 ---- .../flowplayer.pseudostreaming-3.2.13.swf | Bin 4850 -> 0 bytes ...layer.pseudostreaming-byterange-3.2.13.swf | Bin 171038 -> 0 bytes 18 files changed, 12 insertions(+), 1538 deletions(-) delete mode 100644 www/include/FlexPaper_flash/FlexPaperViewer.swf delete mode 100644 www/include/jslibs/audio-player/audio-player-noswfobject.js delete mode 100644 www/include/jslibs/audio-player/audio-player-uncompressed.js delete mode 100644 www/include/jslibs/audio-player/audio-player.js delete mode 100644 www/include/jslibs/audio-player/license.txt delete mode 100644 www/include/jslibs/audio-player/player.swf delete mode 100644 www/include/jslibs/flowplayer/LICENSE.txt delete mode 100644 www/include/jslibs/flowplayer/README.txt delete mode 100644 www/include/jslibs/flowplayer/flowplayer-3.2.13.min.js delete mode 100644 www/include/jslibs/flowplayer/flowplayer-3.2.18.swf delete mode 100644 www/include/jslibs/flowplayer/flowplayer.controls-3.2.16.swf delete mode 100644 www/include/jslibs/flowplayer/pseudostreaming/LICENSE.txt delete mode 100644 www/include/jslibs/flowplayer/pseudostreaming/README.txt delete mode 100644 www/include/jslibs/flowplayer/pseudostreaming/flowplayer.pseudostreaming-3.2.13.swf delete mode 100644 www/include/jslibs/flowplayer/pseudostreaming/flowplayer.pseudostreaming-byterange-3.2.13.swf diff --git a/lib/Alchemy/Phrasea/Controller/Prod/TooltipController.php b/lib/Alchemy/Phrasea/Controller/Prod/TooltipController.php index 0f8f5131f1..1760910b45 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/TooltipController.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/TooltipController.php @@ -43,6 +43,7 @@ class TooltipController extends Controller { return $this->render('prod/Tooltip/Preview.html.twig', [ 'record' => new \record_adapter($this->app, $sbas_id, $record_id), + 'autoplay' => true, 'not_wrapped' => true ]); } diff --git a/templates/web/common/preview.html.twig b/templates/web/common/preview.html.twig index 208cd8daa5..b607d6d017 100644 --- a/templates/web/common/preview.html.twig +++ b/templates/web/common/preview.html.twig @@ -7,6 +7,12 @@ {% set wrap = true %} {% endif %} +{% if autoplay is defined and autoplay %} + {% set autoplay = true %} +{% else %} + {% set autoplay = false %} +{% endif %} + {% set previewHtml5 = null %} {% if app.getAclForUser(app.getAuthenticatedUser()).has_access_to_subdef(record, 'preview') %} @@ -18,4 +24,4 @@ {% set width = preview_obj.get_width() %} {% set height = preview_obj.get_height() %} -{{ thumbnail.format(preview_obj, preview_obj.get_width(), preview_obj.get_height(), '', wrap, false) }} +{{ thumbnail.format(preview_obj, preview_obj.get_width(), preview_obj.get_height(), '', wrap, false, autoplay) }} diff --git a/templates/web/common/thumbnail.html.twig b/templates/web/common/thumbnail.html.twig index 4b8fcb0011..923205e8a5 100644 --- a/templates/web/common/thumbnail.html.twig +++ b/templates/web/common/thumbnail.html.twig @@ -1,4 +1,4 @@ -{% macro format(thumbnail, box_w, box_h, extra_class, wrap, lazyload) %} +{% macro format(thumbnail, box_w, box_h, extra_class, wrap, lazyload, autoplay) %} {% set record_type = thumbnail.get_type() %} {% set box_w = box_w|round %} {% set box_h = box_h|default(box_w)|round %} @@ -10,15 +10,15 @@ {% if record_type == 'VIDEO_MP4' or record_type == 'VIDEO_FLV' %} {% elseif record_type == 'FLEXPAPER' %} {% elseif record_type == 'AUDIO_MP3' %} {% else %} {#