match subtitle overlay aspect ratio to video so it stays inside content area

This commit is contained in:
2026-04-23 07:05:32 +03:00
parent fb18e169fd
commit 9027dab1a1
2 changed files with 45 additions and 83 deletions
+5
View File
@@ -970,6 +970,9 @@ export default function PlayerPage() {
/* Track lists from Jellyfin metadata */
const audioTracks = item ? getAudioStreams(item) : []
const videoStream = ((item as any)?.MediaSources?.[0]?.MediaStreams || []).find((s: any) => s.Type === 'Video')
const videoWidth = videoStream?.Width || 1920
const videoHeight = videoStream?.Height || 1080
/**
* Pick an audio track. For direct-play sources whose underlying <video>
@@ -1183,6 +1186,8 @@ export default function PlayerPage() {
<SubtitleOverlay
playerRef={playerRef}
subtitleUrl={getSubtitleUrl(serverUrl, id, mediaSourceId, subtitleIndex, token)}
videoWidth={videoWidth}
videoHeight={videoHeight}
/>
)
})()}