[skip ci] Avoid double reporting error
This commit is contained in:
1 parent
26285535ac
commit
5fc059f700
1 file changed
+10
-6
@@ -441,6 +441,7 @@ function OnVideoPlayerStateChange() as void
|
|||||||
m.videoPlayingSuccess = true
|
m.videoPlayingSuccess = true
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
errorReported = false
|
||||||
if state = "error"
|
if state = "error"
|
||||||
errorInfo = m.top.errorInfo
|
errorInfo = m.top.errorInfo
|
||||||
errorData = GetPlayerErrorData(content.videoId, errorInfo)
|
errorData = GetPlayerErrorData(content.videoId, errorInfo)
|
||||||
@@ -448,9 +449,10 @@ function OnVideoPlayerStateChange() as void
|
|||||||
LogErrorNoTelemetry(errorData.title, errorData.body)
|
LogErrorNoTelemetry(errorData.title, errorData.body)
|
||||||
m.global.telemetry.LogEvent = {
|
m.global.telemetry.LogEvent = {
|
||||||
level: "error"
|
level: "error"
|
||||||
message: errorData.title + `\n` + errorData.body
|
message: errorData.title + " " + errorData.body
|
||||||
fingerprint: errorData.fingerprint
|
fingerprint: errorData.fingerprint
|
||||||
}
|
}
|
||||||
|
errorReported = true
|
||||||
|
|
||||||
if m.videoPlayingSuccess <> true
|
if m.videoPlayingSuccess <> true
|
||||||
' http for stream format, mediaerror for DASH
|
' http for stream format, mediaerror for DASH
|
||||||
@@ -500,11 +502,13 @@ function OnVideoPlayerStateChange() as void
|
|||||||
errorData = GetPlayerErrorData(content.videoId, errorInfo)
|
errorData = GetPlayerErrorData(content.videoId, errorInfo)
|
||||||
|
|
||||||
LogErrorNoTelemetry(errorData.title, errorData.body)
|
LogErrorNoTelemetry(errorData.title, errorData.body)
|
||||||
m.global.telemetry.LogEvent = {
|
if not errorReported
|
||||||
level: "error"
|
m.global.telemetry.LogEvent = {
|
||||||
message: errorData.title + `\n` + errorData.body
|
level: "error"
|
||||||
fingerprint: errorData.fingerprint
|
message: errorData.title + " " + errorData.body
|
||||||
}
|
fingerprint: errorData.fingerprint
|
||||||
|
}
|
||||||
|
end if
|
||||||
|
|
||||||
buttons = [Tr(Locale.Buttons.PlayNextVideo), Tr(Locale.Buttons.Cancel)]
|
buttons = [Tr(Locale.Buttons.PlayNextVideo), Tr(Locale.Buttons.Cancel)]
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user