]> git.parisson.com Git - telemeta.git/commitdiff
add width and height parameters for the embedded player URL
authoryomguy <yomguy@parisson.com>
Fri, 10 Jun 2011 15:56:56 +0000 (17:56 +0200)
committeryomguy <yomguy@parisson.com>
Fri, 10 Jun 2011 15:56:56 +0000 (17:56 +0200)
telemeta/templates/telemeta_default/mediaitem_player.html
telemeta/urls.py
telemeta/web/base.py

index 957fe2036a3dc6b18c16aa2a20ce761cbf358ad4..214dc4b1094ab175f450dd658e424a1be9a6dbfb 100644 (file)
@@ -25,6 +25,9 @@
     {% endif %}
 {% endif %}
 </div>
+
+width : {{ width }}, height : {{ height }}
+
 {% endblock content%}
 {% endblock layout %}
 
index f7f7cf986be3e7ed94290f4f02bc805f697e73df..0d09c6d8b125e2de17ceaf1a084152944311b04e 100644 (file)
@@ -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<public_id>[A-Za-z0-9._-]+)/player/$', web_view.item_detail,
+    url(r'^items/(?P<public_id>[A-Za-z0-9._-]+)/player/(?P<width>[0-9]+)x(?P<height>[0-9]+)/$', web_view.item_detail,
         dict(template='telemeta/mediaitem_player.html'), name="telemeta-item-player"),
     url(r'^items/(?P<public_id>[A-Za-z0-9._-]+)/performances/$', web_view.item_performances_edit,
         dict(template='telemeta/mediaitem_performances_edit.html'), name="telemeta-item-performances_edit"),
index 5d48bdec498958e5adeddabcf80a0663bcb4c217..2c4219a39a084b1cadef35e0fc3badf53f3e3c64 100644 (file)
@@ -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):