Skip to content

Commit 64cffb0

Browse files
committed
fix: can't turn subtitles off
1 parent 34ed3f7 commit 64cffb0

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

resources/js/components/video/subtitles/PlayerSubtitles.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@ interface PlayerSubtitlesProps {
1919
usingPlayerModernUI?: boolean;
2020
}
2121
22-
const props = defineProps<PlayerSubtitlesProps>();
23-
2422
//#region Shared State
2523
const { stateVideo } = storeToRefs(useContentStore());
2624
const player = inject<Ref<HTMLVideoElement>>('player');
27-
25+
const props = defineProps<PlayerSubtitlesProps>();
2826
//#endregion
2927
3028
//#region Local State
@@ -72,6 +70,7 @@ const defaultSubtitleTrack = computed<SubtitleResource | undefined>(() => {
7270
7371
return subtitles.find((s) => s.is_default) ?? subtitles[0];
7472
});
73+
//#endregion
7574
7675
//#region Functions
7776
/**
@@ -102,6 +101,12 @@ const clearSubtitles = () => {
102101
currentSubtitleTrack.value = undefined;
103102
isShowingSubtitles.value = false;
104103
subtitlesPopover.value?.handleClose();
104+
105+
if (!player?.value) return;
106+
107+
for (const textTrack of player.value.textTracks) {
108+
textTrack.mode = 'hidden';
109+
}
105110
};
106111
//#endregion
107112

0 commit comments

Comments
 (0)