match subtitle overlay aspect ratio to video so it stays inside content area
This commit is contained in:
@@ -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}
|
||||
/>
|
||||
)
|
||||
})()}
|
||||
|
||||
Reference in New Issue
Block a user