mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 10:58:20 -07:00
Merge pull request #4267 from dmitrylyzo/fix-audiocontext-limit
Fix AudioContext limit exceeded
This commit is contained in:
commit
ea79d2651a
@ -294,16 +294,24 @@ import browser from './browser';
|
||||
(browser.tizen && isTizenFhd ? 20000000 : null)));
|
||||
}
|
||||
|
||||
let maxChannelCount = null;
|
||||
|
||||
function getSpeakerCount() {
|
||||
if (maxChannelCount != null) {
|
||||
return maxChannelCount;
|
||||
}
|
||||
|
||||
maxChannelCount = -1;
|
||||
|
||||
const AudioContext = window.AudioContext || window.webkitAudioContext || false; /* eslint-disable-line compat/compat */
|
||||
|
||||
if (AudioContext) {
|
||||
const audioCtx = new AudioContext();
|
||||
|
||||
return audioCtx.destination.maxChannelCount;
|
||||
maxChannelCount = audioCtx.destination.maxChannelCount;
|
||||
}
|
||||
|
||||
return -1;
|
||||
return maxChannelCount;
|
||||
}
|
||||
|
||||
function getPhysicalAudioChannels(options, videoTestElement) {
|
||||
|
Loading…
Reference in New Issue
Block a user