From: Dermot Duffy Date: Sat, 13 Aug 2016 23:40:16 +0000 (+0100) Subject: Address @PaulAnnekov code review comments. X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=c3aac8cae3342a871113b0ad0c49426f9597683c;p=motioneye-debian Address @PaulAnnekov code review comments. - Remove separate needless tag. - Add error handling for video playback. - Pass mimetype from backend to Javascript. --- diff --git a/motioneye/mediafiles.py b/motioneye/mediafiles.py index 398b62b..6890f1e 100644 --- a/motioneye/mediafiles.py +++ b/motioneye/mediafiles.py @@ -21,6 +21,7 @@ import fcntl import functools import hashlib import logging +import mimetypes import multiprocessing import os.path import pipes @@ -291,6 +292,7 @@ def list_media(camera_config, media_type, callback, prefix=None): pipe.send({ 'path': path, + 'mimeType': mimetypes.guess_type(path)[0], 'momentStr': utils.pretty_date_time(datetime.datetime.fromtimestamp(timestamp)), 'momentStrShort': utils.pretty_date_time(datetime.datetime.fromtimestamp(timestamp), short=True), 'sizeStr': utils.pretty_size(size), diff --git a/motioneye/static/js/main.js b/motioneye/static/js/main.js index fae95cc..98fd6ea 100644 --- a/motioneye/static/js/main.js +++ b/motioneye/static/js/main.js @@ -2920,9 +2920,10 @@ function runPictureDialog(entries, pos, mediaType) { var img = $(''); content.append(img); - var video_container = $('