mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Backport pull request #4263 from jellyfin/release-10.8.z
Fix change audio track
Original-merge: 9139153d16
Merged-by: Bill Thornton <thornbill@users.noreply.github.com>
Backported-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
parent
5e6de2d7db
commit
abed235b50
4 changed files with 84 additions and 42 deletions
|
@ -334,6 +334,23 @@ import browser from './browser';
|
|||
return 2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the web engine supports secondary audio.
|
||||
* @param {HTMLVideoElement} videoTestElement The video test element
|
||||
* @returns {boolean} _true_ if the web engine supports secondary audio.
|
||||
*/
|
||||
export function canPlaySecondaryAudio(videoTestElement) {
|
||||
// We rely on HTMLMediaElement.audioTracks
|
||||
// It works in Chrome 79+ with "Experimental Web Platform features" enabled
|
||||
return !!videoTestElement.audioTracks
|
||||
// It doesn't work in Firefox 108 even with "media.track.enabled" enabled (it only sees the first audio track)
|
||||
&& !browser.firefox
|
||||
// It seems to work on Tizen 5.5+ (2020, Chrome 69+). See https://developer.tizen.org/forums/web-application-development/video-tag-not-work-audiotracks
|
||||
&& (browser.tizenVersion >= 5.5 || !browser.tizen)
|
||||
// Assume webOS 5+ (2020, Chrome 68+) supports secondary audio like Tizen 5.5+
|
||||
&& (browser.web0sVersion >= 5.0 || !browser.web0sVersion);
|
||||
}
|
||||
|
||||
export default function (options) {
|
||||
options = options || {};
|
||||
|
||||
|
@ -742,13 +759,7 @@ import browser from './browser';
|
|||
|
||||
profile.CodecProfiles = [];
|
||||
|
||||
// We rely on HTMLMediaElement.audioTracks
|
||||
// It works in Chrome 79+ with "Experimental Web Platform features" enabled
|
||||
// It doesn't work in Firefox 108 even with "media.track.enabled" enabled (it only sees the first audio track)
|
||||
// It seems to work on Tizen 5.5+ (Chrome 69+). See https://developer.tizen.org/forums/web-application-development/video-tag-not-work-audiotracks
|
||||
const supportsSecondaryAudio = !!videoTestElement.audioTracks
|
||||
&& !browser.firefox
|
||||
&& (browser.tizenVersion >= 5.5 || !browser.tizen);
|
||||
const supportsSecondaryAudio = canPlaySecondaryAudio(videoTestElement);
|
||||
|
||||
const aacCodecProfileConditions = [];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue