Fit more error info in the dialog when videos fail

This commit is contained in:
Brahim Hadriche committed 2023-07-29 20:38:47 -04:00
1 parent e4870a752b
commit 151e108183
6 files changed
+20 -7

No files matched your search

+6
View File
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- Slightly more information in the error dialog when videos fail to play
## [0.10.3] - 2023-07-24
### Added
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<component name="Dialog" extends="StandardMessageDialog" >
</component>
@@ -3,13 +3,16 @@ function ShowDialog(message as dynamic, title as string) as object
end function
function ShowDialogButtons(message as dynamic, title as string, buttons as object) as object
dialog = CreateObject("roSGNode", "Dialog")
dialog = CreateObject("roSGNode", "SimpleDialog")
if GetInterface(message, "ifArray") = invalid
message = message.Tokenize(UnixNL()).ToArray()
end if
dialog.message = message
dialog.title = title
dialog.buttons = buttons
deviceInfo = CreateObject("roDeviceInfo")
displaySize = deviceInfo.GetDisplaySize()
dialog.width = displaySize.w - 100
m.top.getScene().dialog = dialog
return dialog
end function
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<component name="SimpleDialog" extends="StandardMessageDialog">
</component>
@@ -337,12 +337,16 @@ function OnVideoPlayerStateChange() as void
end if
if state = "error"
messageLines = []
messageLines.push(`errorMsg: ${m.top.errorMsg}`)
messageLines.push(`errorCode: ${m.top.errorCode}`)
messageLines.push(`errorStr: ${m.top.errorStr}`)
errorInfo = m.top.errorInfo
messageLines = [`VideoId: ${m.top.videoId}`]
for each info in errorInfo
messageLines.push(`${info}: ${errorInfo[info]}`)
end for
ShowDialog(messageLines, "Error playing video")
ShowDialog(messageLines, `Error playing video ${m.top.videoId}`)
CloseVideo()
end if
end function