]> git.parisson.com Git - mezzo.git/commitdiff
test video length
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 21 Apr 2016 15:19:37 +0000 (17:19 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 21 Apr 2016 15:19:37 +0000 (17:19 +0200)
app/festival/models.py

index 72267631bc137715f5a3ba55a08dd47cd8ce3c38..17fa92824d98ed1a4966314480ff4c7b75d96bf8 100644 (file)
@@ -144,8 +144,9 @@ class Media(Displayable, RichText):
             elif self.closed_source_mime_type in source.attrib['type']:
                 self.closed_source_url = source.attrib['src']
         video = self.q('video')
-        if 'poster' in video[0].attrib.keys():
-            self.poster_url = video[0].attrib['poster']
+        if len(video):
+            if 'poster' in video[0].attrib.keys():
+                self.poster_url = video[0].attrib['poster']
 
 
 class Audio(Media):