From 5fc059f70055de05e362c2b0ec60b687a9c413ce Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Thu, 4 Sep 2025 12:23:45 -0400 Subject: [PATCH] [skip ci] Avoid double reporting error --- .../src/components/VideoPlayer/VideoPlayer.bs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs b/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs index ee75966f..7b8fcf7b 100644 --- a/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs +++ b/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs @@ -441,6 +441,7 @@ function OnVideoPlayerStateChange() as void m.videoPlayingSuccess = true end if + errorReported = false if state = "error" errorInfo = m.top.errorInfo errorData = GetPlayerErrorData(content.videoId, errorInfo) @@ -448,9 +449,10 @@ function OnVideoPlayerStateChange() as void LogErrorNoTelemetry(errorData.title, errorData.body) m.global.telemetry.LogEvent = { level: "error" - message: errorData.title + `\n` + errorData.body + message: errorData.title + " " + errorData.body fingerprint: errorData.fingerprint } + errorReported = true if m.videoPlayingSuccess <> true ' http for stream format, mediaerror for DASH @@ -500,11 +502,13 @@ function OnVideoPlayerStateChange() as void errorData = GetPlayerErrorData(content.videoId, errorInfo) LogErrorNoTelemetry(errorData.title, errorData.body) - m.global.telemetry.LogEvent = { - level: "error" - message: errorData.title + `\n` + errorData.body - fingerprint: errorData.fingerprint - } + if not errorReported + m.global.telemetry.LogEvent = { + level: "error" + message: errorData.title + " " + errorData.body + fingerprint: errorData.fingerprint + } + end if buttons = [Tr(Locale.Buttons.PlayNextVideo), Tr(Locale.Buttons.Cancel)]