1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
This commit is contained in:
Baker Ousley 2025-03-30 11:01:13 -04:00 committed by GitHub
commit 405fe2f9e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1198,6 +1198,20 @@ export default function (view) {
}
}
function autoSelectSubtitleTrack() {
const player = currentPlayer;
const streams = playbackManager.subtitleTracks(player);
const currentIndex = playbackManager.getSubtitleStreamIndex(player) ?? -1;
const defaultIndex = player?.streamInfo?.mediaSource?.DefaultSubtitleStreamIndex ?? -1;
if (currentIndex === -1 && streams.length > 0) {
const subtitleIndex = defaultIndex != -1 ? defaultIndex : streams[0].Index;
playbackManager.setSubtitleStreamIndex(subtitleIndex, player);
} else {
playbackManager.setSubtitleStreamIndex(-1, player);
}
}
/**
* Clicked element.
* To skip 'click' handling on Firefox/Edge.
@ -1413,6 +1427,13 @@ export default function (view) {
playbackManager.previousChapter(currentPlayer);
}
break;
case 'c':
case 'C':
if (!e.shiftKey) {
e.preventDefault();
autoSelectSubtitleTrack();
}
break;
case 'g':
case 'G':
if (!e.shiftKey) {