mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
fix audio-transcoding for iOS v10 and older
opus-in-caf was added in iOS v11; use caf in iOS v12 and newer (iPhone 5s, iPad Air/mini2, iPod 6), use mp3 in iOS v11 and older (iPhone 5c, iPad 4)
This commit is contained in:
parent
40a1c7116e
commit
c9eba39edd
|
@ -2384,7 +2384,7 @@ var mpl = (function () {
|
|||
if (!c)
|
||||
return url;
|
||||
|
||||
return addq(url, 'th=' + (can_ogg ? 'opus' : (IPHONE || MACOS) ? 'caf' : 'mp3'));
|
||||
return addq(url, 'th=' + (can_ogg ? 'opus' : can_caf ? 'caf' : 'mp3'));
|
||||
};
|
||||
|
||||
r.pp = function () {
|
||||
|
@ -2493,7 +2493,8 @@ var mpl = (function () {
|
|||
})();
|
||||
|
||||
|
||||
var can_ogg = true;
|
||||
var can_ogg = true,
|
||||
can_caf = (IPHONE || MACOS) && !/ OS ([1-9]|1[01])_/.test(UA);
|
||||
try {
|
||||
can_ogg = new Audio().canPlayType('audio/ogg; codecs=opus') === 'probably';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue