Skip to content

Commit

Permalink
MDL-56549 lib: Add flac audio extension to html5 support list.
Browse files Browse the repository at this point in the history
  • Loading branch information
kabalin committed Oct 17, 2019
1 parent c77052f commit 043ba1b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/classes/useragent.php
Original file line number Diff line number Diff line change
Expand Up @@ -1123,8 +1123,7 @@ public static function supports_html5($extension) {
$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)) {
Expand Down Expand Up @@ -1158,6 +1157,11 @@ public static function supports_html5($extension) {
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;
Expand Down

0 comments on commit 043ba1b

Please sign in to comment.