Hi there,
I'm working on an app that has a large video that I break up into smaller clips. You can select to play just certain clips which are separate objects in my video array, with the playduration set to the length of the clip. However, I noticed that when the Roku gets to the end of that duration, it does stop the video, but it also triggers the isRequestFailed() message. For instance, here is my event loop that tracks the messages and events during the video playback:
while true
msg = wait(0, port)
if type(msg) = "roVideoScreenEvent" then
print "showHomeScreen | msg = "; msg.getMessage() " | index = "; msg.GetIndex()
if msg.isScreenClosed()
print "Screen closed"
exit while
elseif msg.isRequestFailed()
print "Video request failure: "; msg.GetIndex(); " " msg.GetData()
showVideoFailureMessage()
analytics("videofail", videoId)
elseif msg.isStatusMessage()
print "Video status: "; msg.GetIndex(); " " msg.GetData()
elseif msg.isButtonPressed()
print "Button pressed: "; msg.GetIndex(); " " msg.GetData()
elseif msg.isPlaybackPosition() then
nowpos = msg.GetIndex()
'RegWrite(episode.ContentId, nowpos.toStr())
print "now position"
print nowpos
else
print "Unexpected event type: "; msg.GetType()
end if
else
print "Unexpected message class: "; type(msg)
end if
end while
the isRequestFailed message evaluates as True when the video stops playing (at the correctly determined clip end). This is annoying because I display a dialog box to the user if there is an issue with the video, and right now the dialog box always shows up when the clips stop playing. Is this a known issue or am I doing something wrong?
Thanks in advance,
-Kaitlin