File tree Expand file tree Collapse file tree
resources/js/components/video/subtitles Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,12 +19,10 @@ interface PlayerSubtitlesProps {
1919 usingPlayerModernUI? : boolean ;
2020}
2121
22- const props = defineProps <PlayerSubtitlesProps >();
23-
2422// #region Shared State
2523const { stateVideo } = storeToRefs (useContentStore ());
2624const 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
You can’t perform that action at this time.
0 commit comments