MDL-56549 lib: Add flac audio extension to html5 support list.

This is now supported by most browsers:
https://en.wikipedia.org/wiki/HTML5_audio
https://caniuse.com/#feat=flac
This commit is contained in:
Ruslan Kabalin 2019-10-03 17:40:40 +01:00
parent c77052fb2b
commit 043ba1b221

View File

@ -1123,8 +1123,7 @@ class core_useragent {
$extension = strtolower($extension);
$supportedvideo = array('m4v', 'webm', 'ogv', 'mp4', 'mov');
$supportedaudio = array('ogg', 'oga', 'aac', 'm4a', 'mp3', 'wav');
// TODO MDL-56549 Flac will be supported in Firefox 51 in January 2017.
$supportedaudio = array('ogg', 'oga', 'aac', 'm4a', 'mp3', 'wav', 'flac');
// Basic extension support.
if (!in_array($extension, $supportedvideo) && !in_array($extension, $supportedaudio)) {
@ -1158,6 +1157,11 @@ class core_useragent {
if ($isogg && (self::is_ie() || self::is_edge() || self::is_safari() || self::is_safari_ios())) {
return false;
}
// FLAC is not supported in IE and Edge (below 16.0).
if ($extension === 'flac' &&
(self::is_ie() || (self::is_edge() && !self::check_edge_version('16.0')))) {
return false;
}
// Wave is not supported in IE.
if ($extension === 'wav' && self::is_ie()) {
return false;