Permalink
Browse files

Bugfix on url passing - now can provide url as variable, string or ar…

…ray playlist
  • Loading branch information...
1 parent 08c4e13 commit a17efad0c0f6d46eecd83f8329187891467ebd8d @mfitzp committed Dec 22, 2009
Showing with 8 additions and 4 deletions.
  1. +8 −4 flowplayer/templatetags/flowplayer_tags.py
@@ -48,13 +48,17 @@ def render(self, context):
# Try resolve this variable in the template context
self.media = self.media.resolve(context)
except VariableDoesNotExist:
- # Cannot resolve, therefore it's an url
- self.media_url = self.media
- self.media_playlist = False
- else:
+ # Cannot resolve, therefore treat as url string
+ pass
+
+ # Have we got an array or a string?
+ if isinstance(self.media, list):
# Can resolve, push first url into the url variable
self.media_url = self.media[0]
self.media_playlist = self.media
+ else:
+ self.media_url = self.media
+ self.media_playlist = False
t = loader.get_template('flowplayer/flowplayer.html')
code_context = Context(

0 comments on commit a17efad

Please sign in to comment.