From 115390fde310aee953018483e003db8115dc0cdc Mon Sep 17 00:00:00 2001 From: ccd0 Date: Tue, 16 Jun 2020 01:55:26 -0700 Subject: [PATCH] Make video features work with .ogv videos. --- src/Images/Gallery.coffee | 2 +- src/config/Config.coffee | 2 +- src/platform/$.coffee | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Images/Gallery.coffee b/src/Images/Gallery.coffee index ff2299bf6..476cfb450 100644 --- a/src/Images/Gallery.coffee +++ b/src/Images/Gallery.coffee @@ -133,7 +133,7 @@ Gallery = load: (thumb, errorCB) -> ext = thumb.href.match /\w*$/ - elType = $.getOwn({'webm': 'video', 'mp4': 'video', 'pdf': 'iframe'}, ext) or 'img' + elType = $.getOwn({'webm': 'video', 'mp4': 'video', 'ogv': 'video', 'pdf': 'iframe'}, ext) or 'img' file = $.el elType $.extend file.dataset, thumb.dataset $.on file, 'error', errorCB diff --git a/src/config/Config.coffee b/src/config/Config.coffee index 7b63213d3..6df90c6a7 100644 --- a/src/config/Config.coffee +++ b/src/config/Config.coffee @@ -271,7 +271,7 @@ Config = ] 'Replace WEBM': [ false - 'Replace webm and mp4 thumbnails with the actual video. Probably will degrade browser performance ;)' + 'Replace webm, mp4, and ogv thumbnails with the actual video. Probably will degrade browser performance ;)' ] 'Image Prefetching': [ true diff --git a/src/platform/$.coffee b/src/platform/$.coffee index 5add9f92c..342d16a3d 100644 --- a/src/platform/$.coffee +++ b/src/platform/$.coffee @@ -491,7 +491,7 @@ $.unescape = (text) -> (({'&': '&', ''': "'", '"': '"', '<': '<', '>': '>', ',': ','})[c]) $.isImage = (url) -> /\.(jpe?g|png|gif|bmp|webp)$/i.test url -$.isVideo = (url) -> /\.(webm|mp4)$/i.test url +$.isVideo = (url) -> /\.(webm|mp4|ogv)$/i.test url $.engine = do -> return 'edge' if /Edge\//.test navigator.userAgent