Merge branch 'master_MDL-66972_Streaming_file_types' of https://github.com/mattporritt/moodle

This commit is contained in:
Eloy Lafuente (stronk7)
2019-12-18 19:39:18 +01:00
4 changed files with 30 additions and 4 deletions
+4 -1
View File
@@ -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')),
+2 -2
View File
@@ -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;
}
+23
View File
@@ -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;
}
+1 -1
View File
@@ -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