]> git.parisson.com Git - telemeta.git/commitdiff
add MP4 streaming
authoryomguy <yomguy@parisson.com>
Mon, 2 Apr 2012 10:27:28 +0000 (12:27 +0200)
committeryomguy <yomguy@parisson.com>
Mon, 2 Apr 2012 10:27:28 +0000 (12:27 +0200)
telemeta/views/base.py

index c9c27352d80fe7b0ddbf1a56abc544dbd2486d01..7421f7cd38dd1aadc5a1f18bc13918bf805821e6 100644 (file)
@@ -930,6 +930,14 @@ class ItemView(object):
             messages.error(request, title)
             return render(request, 'telemeta/messages.html', {'description' : description})
 
+        #FIXME: MP4 handling in TimeSide
+        if 'mp4' in extension:
+            mime_type = 'video/mp4'
+            video = item.file.path
+            response = HttpResponse(stream_from_file(video), mimetype = mime_type)
+            response['Content-Disposition'] = 'attachment'
+            return response
+
         for encoder in self.encoders:
             if encoder.file_extension() == extension:
                 break