Skip to content

Commit 9b3fc62

Browse files
authored
Merge pull request #6462 from dmitrylyzo/fix-target-fps
2 parents 8994299 + 36aa4dc commit 9b3fc62

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/plugins/htmlVideoPlayer/plugin.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,12 @@ function requireHlsPlayer(callback) {
119119
});
120120
}
121121

122+
function getMediaStreamVideoTracks(mediaSource) {
123+
return mediaSource.MediaStreams.filter(function (s) {
124+
return s.Type === 'Video';
125+
});
126+
}
127+
122128
function getMediaStreamAudioTracks(mediaSource) {
123129
return mediaSource.MediaStreams.filter(function (s) {
124130
return s.Type === 'Audio';
@@ -1274,6 +1280,9 @@ export class HtmlVideoPlayer {
12741280
});
12751281
const htmlVideoPlayer = this;
12761282
import('@jellyfin/libass-wasm').then(({ default: SubtitlesOctopus }) => {
1283+
const mediaSource = this._currentPlayOptions.mediaSource;
1284+
const videoStream = getMediaStreamVideoTracks(mediaSource)[0];
1285+
12771286
const options = {
12781287
video: videoElement,
12791288
subUrl: getTextTrackUrl(track, item),
@@ -1296,7 +1305,7 @@ export class HtmlVideoPlayer {
12961305
dropAllAnimations: false,
12971306
libassMemoryLimit: 40,
12981307
libassGlyphLimit: 40,
1299-
targetFps: 24,
1308+
targetFps: videoStream?.ReferenceFrameRate || videoStream?.RealFrameRate || 24,
13001309
prescaleFactor: 0.8,
13011310
prescaleHeightLimit: 1080,
13021311
maxRenderHeight: 2160,

0 commit comments

Comments
 (0)