From 343d3f42d4e27e744813ec7f0d55285970903f97 Mon Sep 17 00:00:00 2001 From: Frederik Milling Pytlick Date: Mon, 6 Dec 2021 15:11:50 +0100 Subject: [PATCH] MDL-73046 media_html5video: Fixed .mov files .mov files will now have the mimetype 'video/mp4' instead of 'video/quicktime'. (Only if the user's browser is chromium-based) --- media/player/html5video/classes/plugin.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/media/player/html5video/classes/plugin.php b/media/player/html5video/classes/plugin.php index 6c62b185337..a20b9d24774 100644 --- a/media/player/html5video/classes/plugin.php +++ b/media/player/html5video/classes/plugin.php @@ -50,6 +50,10 @@ class media_html5video_plugin extends core_media_player_native { $sources = array(); foreach ($urls as $url) { $mimetype = core_media_manager::instance()->get_mimetype($url); + if ($mimetype === 'video/quicktime' && (core_useragent::is_chrome() || core_useragent::is_edge())) { + // Set mimetype of quicktime videos to mp4 for Chrome/Edge browsers. + $mimetype = 'video/mp4'; + } $source = html_writer::empty_tag('source', array('src' => $url, 'type' => $mimetype)); if ($mimetype === 'video/mp4') { if ($oldandroid) {