From 58beb4abc9d17e2839f3d1e325da7a0e10b1d6c6 Mon Sep 17 00:00:00 2001 From: Kim Nguyen Date: Wed, 20 Apr 2022 15:00:12 -0400 Subject: [PATCH] Fix .mov for edge and chrome, enable fallback thumbnail. #22 --- functions.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index 87a1bf5..69628e9 100644 --- a/functions.php +++ b/functions.php @@ -57,7 +57,7 @@ function centerrow_output_lightgallery($files = null) { 'description' => 'data-sub-html="'. metadata($media, array('Dublin Core', 'Description')) . '"' ]; $mediaCaptionAttribute = ($mediaCaption) ? $mediaCaptionOptions[$mediaCaption] : ''; - $mediaType = $media->mime_type; + $mediaType = ($media->mime_type == 'video/quicktime') ? 'video/mp4' : $media->mime_type; if (strpos($mediaType, 'video') !== false) { $videoSrcObject = [ 'source' => [ @@ -84,7 +84,8 @@ function centerrow_output_lightgallery($files = null) { } } $videoSrcJson = json_encode($videoSrcObject); - $html .= '
  • '; + $videoThumbnail = ($media->hasThumbnail()) ? metadata($media, 'thumbnail_uri') : img('fallback-video.png'); + $html .= '
  • '; } else if ($mediaType == 'application/pdf') { $html .= '
  • '; } else {