Added sources as JSON data attribute to videos elements
authorThierry Florac <tflorac@ulthar.net>
Mon, 28 Sep 2020 15:26:53 +0200
changeset 132 2f7e36cb0e05
parent 131 41ec6731bf1b
child 133 199e70b677d6
Added sources as JSON data attribute to videos elements
src/pyams_media/skin/templates/video.pt
--- a/src/pyams_media/skin/templates/video.pt	Mon Sep 28 15:25:24 2020 +0200
+++ b/src/pyams_media/skin/templates/video.pt	Mon Sep 28 15:26:53 2020 +0200
@@ -7,7 +7,8 @@
 				   global min_width 0;
 				   global previous_type None;"
 	   controls="${'controls' if controls else None}"
-	   poster="${href}/++thumb++${size[0]}x${size[1]}.png?_=${tales:timestamp(thumbnail)}">
+	   poster="${href}/++thumb++${size[0]}x${size[1]}.png?_=${tales:timestamp(thumbnail)}"
+	   data-ams-sources='${conversions.get_sources(request)}'>
 	<tal:loop repeat="conversion conversions.get_conversions(order=('video/mp4','video/webm','video/ogg','video/x-flv'))">
 		<tal:var define="video_type tales:video_type(conversion);
 						 min_width ((media_width or 0) + 1) if (video_type == previous_type) else 0;