Skip to content

Commit

Permalink
Merge pull request #6462 from dmitrylyzo/fix-target-fps
Browse files Browse the repository at this point in the history
  • Loading branch information
thornbill authored Jan 23, 2025
2 parents 8994299 + 36aa4dc commit 9b3fc62
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/plugins/htmlVideoPlayer/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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),
Expand All @@ -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,
Expand Down

0 comments on commit 9b3fc62

Please sign in to comment.