From: Dermot Duffy Date: Mon, 6 Jun 2016 19:23:17 +0000 (+0100) Subject: - Initial version of movie playback via HTML5 video tags. X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=d2811891a530d9af4ec6d1fe7f05fc5f4d724b1b;p=motioneye-debian - Initial version of movie playback via HTML5 video tags. --- diff --git a/motioneye/handlers.py b/motioneye/handlers.py index 7a3ea78..1d6d17e 100644 --- a/motioneye/handlers.py +++ b/motioneye/handlers.py @@ -18,13 +18,15 @@ import datetime import json import logging +import mimetypes import os import re import socket import subprocess +from tornado import httputil from tornado.ioloop import IOLoop -from tornado.web import RequestHandler, HTTPError, asynchronous +from tornado.web import RequestHandler, StaticFileHandler, HTTPError, asynchronous import config import mediafiles @@ -977,7 +979,7 @@ class PictureHandler(BaseHandler): self.set_header('Content-Type', 'image/jpeg') self.set_header('Content-Disposition', 'attachment; filename=' + pretty_filename + ';') - self.finish(response) + self.finish(response.body) remote.get_media_content(camera_config, filename=filename, media_type='picture', callback=on_response) @@ -1338,28 +1340,74 @@ class MovieHandler(BaseHandler): 'filename': filename, 'id': camera_id}) camera_config = config.get_camera(camera_id) + + # To facilitiate cross-browser HTML5