Commit 513d37c0 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1838483: support .wav and .m4a for embedded media"

parents 3e009625 4681451f
......@@ -263,6 +263,8 @@ class PluginBlocktypeInternalmedia extends MaharaCoreBlocktype {
'ogv' => 'html5video',
'webm' => 'html5video',
'3gp' => 'html5video',
'wav' => 'html5audio',
'm4a' => 'html5audio',
);
}
......
......@@ -510,5 +510,27 @@ function xmldb_artefact_file_upgrade($oldversion=0) {
clear_resized_images_cache();
}
if ($oldversion < 2019081900) {
log_debug("Update m4a, m4b, m4p and m4r file types to be audio/mp4 mimetype");
// For existing video/mp4 that need to have their mimetype updated to audio/mp4
execute_sql("UPDATE {artefact}
SET artefacttype = 'audio'
WHERE id IN (SELECT artefact FROM {artefact_file_files}
WHERE oldextension IN ('m4a', 'm4b', 'm4p', 'm4r'));
");
execute_sql("UPDATE {artefact_file_files} SET filetype = 'audio/mp4'
WHERE (oldextension in ('m4a', 'm4b', 'm4p', 'm4r')
AND filetype = 'video/mp4');");
// Make the m4a type enabled so existing blocks display correctly
$options = array();
if ($data = get_config_plugin('blocktype', 'internalmedia', 'enabledtypes')) {
$options = unserialize($data);
}
$options[] = 'm4a';
set_config_plugin('blocktype', 'internalmedia', 'enabledtypes', serialize($options));
}
return $status;
}
......@@ -165,25 +165,25 @@
<filetype>
<description>m4a</description>
<mimetypes>
<mimetype>video/mp4</mimetype>
<mimetype>audio/mp4</mimetype>
</mimetypes>
</filetype>
<filetype>
<description>m4p</description>
<mimetypes>
<mimetype>video/mp4</mimetype>
<mimetype>audio/mp4</mimetype>
</mimetypes>
</filetype>
<filetype>
<description>m4b</description>
<mimetypes>
<mimetype>video/mp4</mimetype>
<mimetype>audio/mp4</mimetype>
</mimetypes>
</filetype>
<filetype>
<description>m4r</description>
<mimetypes>
<mimetype>video/mp4</mimetype>
<mimetype>audio/mp4</mimetype>
</mimetypes>
</filetype>
<filetype>
......
......@@ -253,6 +253,7 @@ $string['bz2'] = 'Bzip2 compressed file';
$string['txt'] = 'Plain text file';
$string['video'] = 'Video file';
$string['wav'] = 'WAV audio file';
$string['m4a'] = 'M4A audio file';
$string['wmv'] = 'WMV video file';
$string['xml'] = 'XML file';
$string['zip'] = 'ZIP archive';
......
......@@ -12,6 +12,5 @@
defined('INTERNAL') || die();
$config = new stdClass();
$config->version = 2017101300;
$config->release = '1.3.0';
$config->version = 2019081900;
$config->release = '1.3.1';
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment