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

Update src/controllers/playback/video/index.js

Co-authored-by: viown <48097677+viown@users.noreply.github.com>
This commit is contained in:
Baker Ousley 2024-09-30 12:34:01 -05:00 committed by GitHub
parent 8bf4542957
commit 3f60e7df4c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1183,12 +1183,8 @@ export default function (view) {
const defaultIndex = player?.streamInfo?.mediaSource?.DefaultSubtitleStreamIndex ?? -1;
if (currentIndex === -1 && streams.length > 0) {
if (defaultIndex > -1) {
playbackManager.setSubtitleStreamIndex(defaultIndex, player);
} else {
const firstSubtitleIndex = streams[0].Index;
playbackManager.setSubtitleStreamIndex(firstSubtitleIndex, player);
}
const subtitleIndex = defaultIndex != -1 ? defaultIndex : streams[0].Index;
playbackManager.setSubtitleStreamIndex(subtitleIndex, player);
} else {
playbackManager.setSubtitleStreamIndex(-1, player);
}