diff --git a/lib/classes/filetypes.php b/lib/classes/filetypes.php index 258170d8af3..1ed83a98017 100644 --- a/lib/classes/filetypes.php +++ b/lib/classes/filetypes.php @@ -96,7 +96,8 @@ abstract class core_filetypes { 'flv' => array('type' => 'video/x-flv', 'icon' => 'flash', 'groups' => array('video', 'web_video'), 'string' => 'video'), 'f4v' => array('type' => 'video/mp4', 'icon' => 'flash', 'groups' => array('video', 'web_video'), 'string' => 'video'), - + 'fmp4' => array('type' => 'video/mp4', 'icon' => 'mpeg', 'groups' => array('html_video', 'video', 'web_video'), + 'string' => 'video'), 'gallery' => array('type' => 'application/x-smarttech-notebook', 'icon' => 'archive'), 'galleryitem' => array('type' => 'application/x-smarttech-notebook', 'icon' => 'archive'), 'gallerycollection' => array('type' => 'application/x-smarttech-notebook', 'icon' => 'archive'), @@ -275,6 +276,8 @@ abstract class core_filetypes { 'tex' => array('type' => 'application/x-tex', 'icon' => 'text'), 'texi' => array('type' => 'application/x-texinfo', 'icon' => 'text'), 'texinfo' => array('type' => 'application/x-texinfo', 'icon' => 'text'), + 'ts' => array('type' => 'video/MP2T', 'icon' => 'mpeg', 'groups' => array('video', 'web_video'), + 'string' => 'video'), 'tsv' => array('type' => 'text/tab-separated-values', 'icon' => 'text'), 'txt' => array('type' => 'text/plain', 'icon' => 'text', 'defaulticon' => true), 'vtt' => array('type' => 'text/vtt', 'icon' => 'text', 'groups' => array('html_track')), diff --git a/lib/classes/useragent.php b/lib/classes/useragent.php index c8d708565b5..dfea02a4409 100644 --- a/lib/classes/useragent.php +++ b/lib/classes/useragent.php @@ -1122,7 +1122,7 @@ class core_useragent { public static function supports_html5($extension) { $extension = strtolower($extension); - $supportedvideo = array('m4v', 'webm', 'ogv', 'mp4', 'mov'); + $supportedvideo = array('m4v', 'webm', 'ogv', 'mp4', 'mov', 'fmp4'); $supportedaudio = array('ogg', 'oga', 'aac', 'm4a', 'mp3', 'wav', 'flac'); // Basic extension support. @@ -1171,7 +1171,7 @@ class core_useragent { return false; } // Mpeg is not supported in IE below 10.0. - $ismpeg = in_array($extension, ['m4a', 'mp3', 'm4v', 'mp4']); + $ismpeg = in_array($extension, ['m4a', 'mp3', 'm4v', 'mp4', 'fmp4']); if ($ismpeg && (self::is_ie() && !self::check_ie_version('10.0'))) { return false; } diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 73b24ed998f..91a1a20b208 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -3798,5 +3798,28 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2019120500.01); } + if ($oldversion < 2019121800.00) { + // Upgrade MIME types for existing streaming files. + $filetypes = array( + '%.fmp4' => 'video/mp4', + '%.ts' => 'video/MP2T', + '%.mpd' => 'application/dash+xml', + '%.m3u8' => 'application/x-mpegURL', + ); + + $select = $DB->sql_like('filename', '?', false); + foreach ($filetypes as $extension => $mimetype) { + $DB->set_field_select( + 'files', + 'mimetype', + $mimetype, + $select, + array($extension) + ); + } + + upgrade_main_savepoint(true, 2019121800.00); + } + return true; } diff --git a/version.php b/version.php index f35ab59ece8..fd996d6cfba 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2019121200.00; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2019121800.00; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes. $release = '3.9dev (Build: 20191212)'; // Human-friendly version name