1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge pull request #5871 from gnattu/better-safari-profile

Better codec profile for Safari  with 10.10 features
This commit is contained in:
Bill Thornton 2024-08-20 17:19:28 -04:00 committed by GitHub
commit c9105dcad4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 37 additions and 7 deletions

View file

@ -28,6 +28,16 @@ function canPlayNativeHls() {
|| media.canPlayType('application/vnd.apple.mpegURL').replace(/no/, ''));
}
export function enableHlsJsPlayerForCodecs(mediaSource, mediaType) {
// Workaround for VP9 HLS support on desktop Safari
// Force using HLS.js because desktop Safari's native HLS player does not play VP9 over HLS
// browser.osx will return true on iPad, cannot use
if (!browser.iOS && browser.safari && mediaSource.MediaStreams.some(x => x.Codec === 'vp9')) {
return true;
}
return enableHlsJsPlayer(mediaSource.RunTimeTicks, mediaType);
}
export function enableHlsJsPlayer(runTimeTicks, mediaType) {
if (window.MediaSource == null) {
return false;