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

Better codec profile for Safari with 10.10 features

This uses the new VP9 remuxing and audio remuxing features to reduce transcoding on Safari, also removed some problematic direct play profiles.

- Add opus profile for Safari
- Add VP9 remuxing profile for Safari
- Remove Vorbis profile on non-webm container for Safari
- Remove direct VP9 playback in mp4 container for iOS Safari
This commit is contained in:
gnattu 2024-08-04 13:55:05 +08:00
parent d770e40130
commit a386512def
3 changed files with 39 additions and 4 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;