diff --git a/components/video-player/controls/DropdownView.tsx b/components/video-player/controls/DropdownView.tsx index 34666374..fba7cef2 100644 --- a/components/video-player/controls/DropdownView.tsx +++ b/components/video-player/controls/DropdownView.tsx @@ -237,27 +237,25 @@ const DropdownView: React.FC = ({ showControls }) => { { - if (next) { - if ("deliveryUrl" in sub && sub.deliveryUrl) { - setSubtitleURL && - setSubtitleURL( - api?.basePath + sub.deliveryUrl, - sub.name - ); - - console.log( - "Set external subtitle: ", - api?.basePath + sub.deliveryUrl + onValueChange={() => { + if ("deliveryUrl" in sub && sub.deliveryUrl) { + setSubtitleURL && + setSubtitleURL( + api?.basePath + sub.deliveryUrl, + sub.name ); - } else { - console.log("Set sub index: ", sub.index); - setSubtitleTrack && setSubtitleTrack(sub.index); - } - setSelectedSubtitleIndex(sub.index); - console.log("Subtitle: ", sub); + console.log( + "Set external subtitle: ", + api?.basePath + sub.deliveryUrl + ); + } else { + console.log("Set sub index: ", sub.index); + setSubtitleTrack && setSubtitleTrack(sub.index); } + + setSelectedSubtitleIndex(sub.index); + console.log("Subtitle: ", sub); }} > @@ -308,11 +306,9 @@ const DropdownView: React.FC = ({ showControls }) => { { - if (next) { - setSelectedAudioIndex(track.index); - setAudioTrack && setAudioTrack(track.index); - } + onValueChange={() => { + setSelectedAudioIndex(track.index); + setAudioTrack && setAudioTrack(track.index); }} > @@ -325,12 +321,10 @@ const DropdownView: React.FC = ({ showControls }) => { { - if (next) { - if (audioIndex === track.index.toString()) return; - setSelectedAudioIndex(track.index); - ChangeTranscodingAudio(track.index); - } + onValueChange={() => { + if (audioIndex === track.index.toString()) return; + setSelectedAudioIndex(track.index); + ChangeTranscodingAudio(track.index); }} >