Completed subtitle feature

This commit is contained in:
Alex Kim
2024-12-12 04:23:09 +11:00
parent 3fb20a8ca2
commit 35fcb5ca0c
7 changed files with 137 additions and 190 deletions

View File

@@ -187,12 +187,20 @@ const DropdownView: React.FC<DropdownViewProps> = ({ showControls }) => {
key={`subtitle-item-${idx}`}
onValueChange={() => {
console.log("sub", sub);
if (subtitleIndex === sub?.index.toString()) return;
if (
subtitleIndex ===
(sub.IsTextSubtitleStream && isOnTextSubtitle
? getSourceSubtitleIndex(sub.index).toString()
: sub?.index.toString())
)
return;
router.setParams({
subtitleIndex: getSourceSubtitleIndex(
sub.index
).toString(),
});
console.log("Got here");
if (sub.IsTextSubtitleStream && isOnTextSubtitle) {
setSubtitleTrack && setSubtitleTrack(sub.index);