From 6f19f270ba0c220266546a6c8d23210108d75b08 Mon Sep 17 00:00:00 2001 From: F0x1 <39696712+F0x1@users.noreply.github.com> Date: Sat, 14 Dec 2024 15:07:03 -0800 Subject: [PATCH] Fix: Resolved issue for switching audio tracks - Added logic to stop `LoadMetaDataTask` before reusing it to prevent potential conflicts. - Improved comments for clarity on metadata task configuration and execution. --- components/video/VideoPlayerView.bs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/video/VideoPlayerView.bs b/components/video/VideoPlayerView.bs index 6340cd9b0..4893dab20 100644 --- a/components/video/VideoPlayerView.bs +++ b/components/video/VideoPlayerView.bs @@ -344,11 +344,17 @@ sub onAudioIndexChange() ' Save the current video position m.global.queueManager.callFunc("setTopStartingPoint", int(m.top.position) * 10000000&) - m.top.control = "stop" + ' Ensure metadata task is stopped before reusing + if m.LoadMetaDataTask.control = "RUN" + m.LoadMetaDataTask.control = "STOP" + end if + ' Configure metadata task with updated audio index m.LoadMetaDataTask.selectedSubtitleIndex = m.top.SelectedSubtitle m.LoadMetaDataTask.selectedAudioStreamIndex = m.top.audioIndex m.LoadMetaDataTask.itemId = m.currentItem.id + + ' Observe content and start task m.LoadMetaDataTask.observeField("content", "onVideoContentLoaded") m.LoadMetaDataTask.control = "RUN" end sub