Permalink
Browse files

Can now play from QuerySet type, as well as list or url, pass in Quer…

…ySet with an .url property to use. Builds playlist automatically
  • Loading branch information...
1 parent 8b5be05 commit ce70f8adf5ebc410a1423476f8f37e40c0017e4e @mfitzp committed Aug 6, 2010
Showing with 8 additions and 1 deletion.
  1. +2 −0 README.txt
  2. +1 −1 flowplayer/templates/flowplayer/flowplayer.html
  3. +5 −0 flowplayer/templatetags/flowplayer_tags.py
View
@@ -13,3 +13,5 @@ Starting as a fork of django-videoplayer, the purpose of this app is to provide
complete implementation of flowplayer configuration from within the Django framework.
Currently it is possible to output multiple player 'classes' using an optional tag
allowing different media to be presented in different ways.
+
+Now requires JQuery
@@ -12,7 +12,7 @@
{% if player_config.clip %}
clip : {
{% for keycl, valuecl in player_config.clip.items %}
- {{ keycl }}: {{ valuecl }},
+ {{ keycl|safe }}: {{ valuecl|safe }},
{% endfor %}
},
{% endif %}
@@ -1,4 +1,5 @@
from django.conf import settings
+from django.db.models.query import QuerySet
from django.template import TemplateSyntaxError, VariableDoesNotExist, Node
from django.template import Library, Variable, loader, Context
@@ -58,6 +59,10 @@ def render(self, context):
# Can resolve, push first url into the url variable
self.media_url = self.media[0]['url']
self.media_playlist = self.media
+ if isinstance(self.media, QuerySet):
+ # Can resolve, push first url into the url variable
+ self.media_url = self.media[0].url
+ self.media_playlist = self.media
else:
self.media_url = self.media
self.media_playlist = False

0 comments on commit ce70f8a

Please sign in to comment.