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

Merge pull request #6462 from dmitrylyzo/fix-target-fps

This commit is contained in:
Bill Thornton 2025-01-22 19:49:55 -05:00 committed by GitHub
commit 9b3fc622c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -119,6 +119,12 @@ function requireHlsPlayer(callback) {
});
}
function getMediaStreamVideoTracks(mediaSource) {
return mediaSource.MediaStreams.filter(function (s) {
return s.Type === 'Video';
});
}
function getMediaStreamAudioTracks(mediaSource) {
return mediaSource.MediaStreams.filter(function (s) {
return s.Type === 'Audio';
@ -1274,6 +1280,9 @@ export class HtmlVideoPlayer {
});
const htmlVideoPlayer = this;
import('@jellyfin/libass-wasm').then(({ default: SubtitlesOctopus }) => {
const mediaSource = this._currentPlayOptions.mediaSource;
const videoStream = getMediaStreamVideoTracks(mediaSource)[0];
const options = {
video: videoElement,
subUrl: getTextTrackUrl(track, item),
@ -1296,7 +1305,7 @@ export class HtmlVideoPlayer {
dropAllAnimations: false,
libassMemoryLimit: 40,
libassGlyphLimit: 40,
targetFps: 24,
targetFps: videoStream?.ReferenceFrameRate || videoStream?.RealFrameRate || 24,
prescaleFactor: 0.8,
prescaleHeightLimit: 1080,
maxRenderHeight: 2160,