Use asyncStopSemantics to prevent execution timeout crashes (#246)
* Use asyncStopSemantics to prevent execution timeout crashes * Clarify * Changelog * no message
This commit is contained in:
1 parent
0a7a6c65e2
commit
1cb80f71b5
2 files changed
+11
-3
No files matched your search
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
- A rare bug that causes the app to crash when displaying video cells
|
- A rare bug that causes the app to crash when displaying video cells
|
||||||
- A rare bug where a long press can cause a crash
|
- A rare bug where a long press can cause a crash
|
||||||
|
- [Attempt] to fix a crash caused by execution timeout when stopping a video takes too long
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,16 @@ function Init()
|
|||||||
' This is used to prevent the video from playing the next video when we are
|
' This is used to prevent the video from playing the next video when we are
|
||||||
' still trying to find a working stream url
|
' still trying to find a working stream url
|
||||||
m.ignoreNextFinishedState = false
|
m.ignoreNextFinishedState = false
|
||||||
|
|
||||||
|
' asyncStopSemantics available since Roku OS 12.5
|
||||||
|
' It is set to true because stopping synchronously causes timeout and crash
|
||||||
|
' Usually we would need to wait for the video state to move to "stopping" then to "stopped"
|
||||||
|
' before considering the video node closed, and creating a new one.
|
||||||
|
' However, since we have a task to load video details, there should be enough time for the
|
||||||
|
' video node to close before we create a new one.
|
||||||
|
if m.top.hasField("asyncStopSemantics")
|
||||||
|
m.top.asyncStopSemantics = true
|
||||||
|
end if
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function OnNodeReady()
|
function OnNodeReady()
|
||||||
@@ -134,9 +144,6 @@ function Close(_unused as dynamic)
|
|||||||
SponsorBlock.RemoveNotifcation(m.notifications)
|
SponsorBlock.RemoveNotifcation(m.notifications)
|
||||||
end function
|
end function
|
||||||
|
|
||||||
' TODO:P2 investigate timeouts caused by control="stop" being synchrounous and too slow
|
|
||||||
' See if `asyncStopSemantics` would fix this
|
|
||||||
' Test if stopping a video asynchrnously and loading another one immediately works or not
|
|
||||||
function OnVideoPlayerStateChange() as void
|
function OnVideoPlayerStateChange() as void
|
||||||
state = m.top.state
|
state = m.top.state
|
||||||
content = m.top.content
|
content = m.top.content
|
||||||
|
|||||||
Reference in new issue
Block a user