Version 0.1.8 0.1.8
authorThierry Florac <thierry.florac@onf.fr>
Fri, 13 Oct 2017 10:21:11 +0200
changeset 60 1e70316e086a
parent 59 4d725464e237
child 61 f83e22210fda
Version 0.1.8
buildout.cfg
docs/HISTORY.txt
setup.py
src/pyams_media/locales/fr/LC_MESSAGES/pyams_media.mo
src/pyams_media/locales/fr/LC_MESSAGES/pyams_media.po
src/pyams_media/zmi/audio.py
src/pyams_media/zmi/templates/audio-preview.pt
--- a/buildout.cfg	Fri Oct 13 09:09:23 2017 +0200
+++ b/buildout.cfg	Fri Oct 13 10:21:11 2017 +0200
@@ -74,4 +74,4 @@
 eggs = pyams_media [test]
 
 [versions]
-pyams_media = 0.1.7
+pyams_media = 0.1.8
--- a/docs/HISTORY.txt	Fri Oct 13 09:09:23 2017 +0200
+++ b/docs/HISTORY.txt	Fri Oct 13 10:21:11 2017 +0200
@@ -1,6 +1,11 @@
 History
 =======
 
+0.1.8
+-----
+ - added video preview
+ - updated TALES extensions interfaces
+
 0.1.7
 -----
  - commit transaction before adding watermark to video thumbnail
--- a/setup.py	Fri Oct 13 09:09:23 2017 +0200
+++ b/setup.py	Fri Oct 13 10:21:11 2017 +0200
@@ -22,7 +22,7 @@
 README = os.path.join(DOCS, 'README.txt')
 HISTORY = os.path.join(DOCS, 'HISTORY.txt')
 
-version = '0.1.7'
+version = '0.1.8'
 long_description = open(README).read() + '\n\n' + open(HISTORY).read()
 
 tests_require = []
Binary file src/pyams_media/locales/fr/LC_MESSAGES/pyams_media.mo has changed
--- a/src/pyams_media/locales/fr/LC_MESSAGES/pyams_media.po	Fri Oct 13 09:09:23 2017 +0200
+++ b/src/pyams_media/locales/fr/LC_MESSAGES/pyams_media.po	Fri Oct 13 10:21:11 2017 +0200
@@ -119,11 +119,11 @@
 
 #: src/pyams_media/zmi/video.py:55
 msgid "Select thumbnail..."
-msgstr "Sélectionner l'illustration"
+msgstr "Image de lancement"
 
 #: src/pyams_media/zmi/video.py:66
 msgid "Select thumbnail"
-msgstr "Sélectionner cette illustration"
+msgstr "Sélectionner cette image"
 
 #: src/pyams_media/zmi/video.py:72
 msgid "Thumbnail timestamp"
@@ -131,7 +131,7 @@
 
 #: src/pyams_media/zmi/video.py:81
 msgid "Select video thumbnail"
-msgstr "Sélection de l'illustration"
+msgstr "Image de lancement"
 
 #: src/pyams_media/zmi/video.py:121
 msgid "Thumbnail selected successfully."
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_media/zmi/audio.py	Fri Oct 13 10:21:11 2017 +0200
@@ -0,0 +1,64 @@
+#
+# Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+
+__docformat__ = 'restructuredtext'
+
+
+# import standard library
+from decimal import Decimal
+
+# import interfaces
+from pyams_file.interfaces import IVideo, IThumbnail, IAudio
+from pyams_form.interfaces.form import IWidgetsPrefixViewletsManager, IFormHelp
+from pyams_skin.interfaces.viewlet import IContextActions
+from pyams_utils.interfaces import MANAGE_PERMISSION, VIEW_PERMISSION
+from pyams_zmi.layer import IAdminLayer
+from z3c.form.interfaces import HIDDEN_MODE
+
+# import packages
+from pyams_form.form import AJAXAddForm
+from pyams_form.help import FormHelp
+from pyams_form.schema import CloseButton
+from pyams_pagelet.pagelet import pagelet_config
+from pyams_skin.layer import IPyAMSLayer
+from pyams_skin.viewlet.toolbar import ToolbarActionItem
+from pyams_template.template import template_config
+from pyams_utils.adapter import adapter_config
+from pyams_utils.schema import DottedDecimalField
+from pyams_viewlet.viewlet import viewlet_config, Viewlet
+from pyams_zmi.form import AdminDialogAddForm, AdminDialogDisplayForm
+from pyramid.view import view_config
+from z3c.form import field, button
+from zope.interface import Interface
+
+from pyams_media import _
+
+
+#
+# Video preview
+#
+
+@pagelet_config(name='preview.html', context=IAudio, layer=IPyAMSLayer, permission=VIEW_PERMISSION)
+class AudioPreview(AdminDialogDisplayForm):
+    """Audio preview"""
+
+    label = _("Audio preview")
+    label_css_class = 'fa fa-fw fa-music'
+
+    fields = field.Fields(Interface)
+
+
+@viewlet_config(name='audio-preview-prefix', context=IAudio, layer=IAdminLayer, view=AudioPreview,
+                manager=IWidgetsPrefixViewletsManager)
+@template_config(template='templates/audio-preview.pt')
+class AudioPreviewViewletsPrefix(Viewlet):
+    """Audio preview viewlets prefix"""
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_media/zmi/templates/audio-preview.pt	Fri Oct 13 10:21:11 2017 +0200
@@ -0,0 +1,19 @@
+<div class="flowplayer"
+	 data-ams-plugins="flowplayer"
+	 data-ams-plugin-flowplayer-async="false"
+	 data-ams-callback="PyAMS_media.initPlayer"
+	 tal:attributes="data-ams-plugin-flowplayer-src extension:resource_path('pyams_media.skin:flowplayer');
+					 data-ams-plugin-flowplayer-css extension:resource_path('pyams_media.skin:functional_css');
+					 data-ams-callback-source extension:resource_path('pyams_media.skin:pyams_media');">
+	<video
+		tal:define="href extension:absolute_url(context);
+					conversions extension:conversions(context);">
+		<tal:loop repeat="conversion conversions.get_conversions(order=('audio/ogg', 'audio/mpeg', 'audio/wav'))">
+			<source type="audio/ogg"
+					tal:define="audio_type extension:audio_type(conversion);"
+					tal:condition="audio_type"
+					tal:attributes="type audio_type;
+									src extension:absolute_url(conversion);" />
+		</tal:loop>
+	</video>
+</div>