From: yomguy Date: Fri, 10 Jun 2011 15:56:56 +0000 (+0200) Subject: add width and height parameters for the embedded player URL X-Git-Tag: 1.1~114 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=490d025b49e71909015f1d8768b45665446e1ba1;p=telemeta.git add width and height parameters for the embedded player URL --- diff --git a/telemeta/templates/telemeta_default/mediaitem_player.html b/telemeta/templates/telemeta_default/mediaitem_player.html index 957fe203..214dc4b1 100644 --- a/telemeta/templates/telemeta_default/mediaitem_player.html +++ b/telemeta/templates/telemeta_default/mediaitem_player.html @@ -25,6 +25,9 @@ {% endif %} {% endif %} + +width : {{ width }}, height : {{ height }} + {% endblock content%} {% endblock layout %} diff --git a/telemeta/urls.py b/telemeta/urls.py index f7f7cf98..0d09c6d8 100644 --- a/telemeta/urls.py +++ b/telemeta/urls.py @@ -95,7 +95,7 @@ urlpatterns = patterns('', dict(template='telemeta/mediaitem_copy.html'), name="telemeta-item-copy"), url(r'^item/add/$', web_view.item_add, dict(template='telemeta/mediaitem_add.html'), name="telemeta-item-add"), - url(r'^items/(?P[A-Za-z0-9._-]+)/player/$', web_view.item_detail, + url(r'^items/(?P[A-Za-z0-9._-]+)/player/(?P[0-9]+)x(?P[0-9]+)/$', web_view.item_detail, dict(template='telemeta/mediaitem_player.html'), name="telemeta-item-player"), url(r'^items/(?P[A-Za-z0-9._-]+)/performances/$', web_view.item_performances_edit, dict(template='telemeta/mediaitem_performances_edit.html'), name="telemeta-item-performances_edit"), diff --git a/telemeta/web/base.py b/telemeta/web/base.py index 5d48bdec..2c4219a3 100644 --- a/telemeta/web/base.py +++ b/telemeta/web/base.py @@ -245,7 +245,8 @@ class WebView(object): return previous, next - def item_detail(self, request, public_id=None, marker_id=None, template='telemeta/mediaitem_detail.html'): + def item_detail(self, request, public_id=None, marker_id=None, width=None, height=None, + template='telemeta/mediaitem_detail.html'): """Show the details of a given item""" if not public_id and marker_id: @@ -282,7 +283,7 @@ class WebView(object): 'visualizers': graphers, 'visualizer_id': grapher_id, 'audio_export_enabled': getattr(settings, 'TELEMETA_DOWNLOAD_ENABLED', True), 'previous' : previous, 'next' : next, 'marker': marker_id, 'playlists' : playlists, - 'public_access': public_access, + 'public_access': public_access, 'width': width, 'height': height, }) def get_public_access(self, access, year_from, year_to):