diff --git a/motioneye/handlers.py b/motioneye/handlers.py index d69db8eae..4fe9125f4 100644 --- a/motioneye/handlers.py +++ b/motioneye/handlers.py @@ -19,6 +19,7 @@ import hashlib import json import logging +import mimetypes import os import re import socket @@ -1521,7 +1522,7 @@ def download(self, camera_id, filename): content = mediafiles.get_media_content(camera_config, filename, 'movie') pretty_filename = camera_config['@name'] + '_' + os.path.basename(filename) - self.set_header('Content-Type', 'video/mpeg') + self.set_header('Content-Type', mimetypes.guess_type(filename)[0] or 'video/mpeg') self.set_header('Content-Disposition', 'attachment; filename=' + pretty_filename + ';') self.finish(content) @@ -1533,7 +1534,7 @@ def on_response(response=None, error=None): 'url': remote.pretty_camera_url(camera_config), 'msg': error}}) pretty_filename = os.path.basename(filename) # no camera name available w/o additional request - self.set_header('Content-Type', 'video/mpeg') + self.set_header('Content-Type', mimetypes.guess_type(filename)[0] or 'video/mpeg') self.set_header('Content-Disposition', 'attachment; filename=' + pretty_filename + ';') self.finish(response) diff --git a/motioneye/static/js/main.js b/motioneye/static/js/main.js index e11ff1668..1097a0655 100644 --- a/motioneye/static/js/main.js +++ b/motioneye/static/js/main.js @@ -4932,6 +4932,11 @@ function isFullScreen() { function refreshCameraFrames() { var timestamp = new Date().getTime(); + if ($('div.modal-container').is(':visible')) { + /* pause camera refresh if hidden by a dialog */ + return setTimeout(refreshCameraFrames, 1000); + } + function refreshCameraFrame(cameraId, img, serverSideResize) { if (refreshDisabled[cameraId]) { /* camera refreshing disabled, retry later */