Updated video URL to encode '+' characters
authorThierry Florac <thierry.florac@onf.fr>
Wed, 20 Sep 2017 14:04:57 +0200
changeset 54 9ebc186dc5ff
parent 53 2c2704fcf042
child 55 3bff9e2b8533
Updated video URL to encode '+' characters
src/pyams_media/zmi/templates/video-thumbnail.pt
--- a/src/pyams_media/zmi/templates/video-thumbnail.pt	Tue Sep 19 11:33:37 2017 +0200
+++ b/src/pyams_media/zmi/templates/video-thumbnail.pt	Wed Sep 20 14:04:57 2017 +0200
@@ -13,13 +13,15 @@
 					size thumbnails.get_image_size();"
 		tal:attributes="poster string:${href}/++thumb++${size[0]}x${size[1]}.png">
 		<tal:loop repeat="conversion conversions.get_conversions(order=('video/webm','video/mp4','video/x-flv'))">
-			<source type="video/mp4"
-					tal:define="media_width conversions.get_conversion_width(conversion.__name__);
-								video_type extension:video_type(conversion);"
-					tal:condition="video_type"
-					tal:attributes="type video_type;
-									src extension:absolute_url(conversion);
-									media 'all and (max-width: {0}px)'.format(media_width) if media_width else None;" />
+			<tal:if define="video_type extension:video_type(conversion);"
+					condition="video_type">
+				<source type="video/mp4"
+						tal:define="media_width conversions.get_conversion_width(conversion.__name__);
+									media_src extension:absolute_url(conversion)"
+						tal:attributes="type video_type;
+										src media_src.replace('+', '%2b');
+										media 'all and (max-width: {0}px)'.format(media_width) if media_width else None;" />
+			</tal:if>
 		</tal:loop>
 	</video>
 </div>