katycorp
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2011
09:05 AM
End of PlayDuration throws VideoRequestError
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:
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
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
9 REPLIES 9

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2011
04:19 PM
Re: End of PlayDuration throws VideoRequestError
What's the GetMessage() of the request failed message? You're reporting the index and data, but not the message, which may give a clearer indication of the actual error.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
katycorp
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2011
12:31 PM
Re: End of PlayDuration throws VideoRequestError
Sorry for the delayed response on this. I put the project down for a while and came back to it. The message I get is the generic "An unexpected problem (but not server timeout or HTTP error) has been detected." message. I can also confirm that if the playduration on the object is invalid, it ends normally. I don't understand why this throws an error at all?
-Kaitlin
-Kaitlin

RokuMarkn
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2011
01:58 PM
Re: End of PlayDuration throws VideoRequestError
Are you testing this on 3.0? I think there was a bug in this area in 2.9 that was fixed in 3.0, but I'm not positive about that.
--Mark
--Mark
katycorp
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2011
10:33 AM
Re: End of PlayDuration throws VideoRequestError
I just upgraded yesterday and am still seeing the same behavior. (version 3, build 2191)
katycorp
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2011
11:03 AM
Re: End of PlayDuration throws VideoRequestError
is there a lot of overhead with a small position notification interval? I'm thinking of hacking around this by checking the position more frequently (calling screen.setPositionNotificationPeriod(5) ) and then comparing it to the end of the playstart + playduration to see if they are within a certain amount and using that to decide whether or not to show the error message.
Thanks!
Kaitlin
Thanks!
Kaitlin

RokuKevin
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2011
02:20 PM
Re: End of PlayDuration throws VideoRequestError
There is some overhead, but we've tested with notification periods of 1 second just fine.... The problem is that you probably don't want to be updating the bookmark to your server or the registry every second.
--Kevin
--Kevin
MattBates
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2012
10:49 AM
Re: End of PlayDuration throws VideoRequestError
Is this bug still affecting anyone else?
I seem to get "An unexpected problem (but not server timeout or HTTP error) has been detected." (index -3) when video screen reaches my set playback index, no matter what.
I am on version 4.3 build 1057
Is there a workaround besides comparing playbackPosition and playstart?
I seem to get "An unexpected problem (but not server timeout or HTTP error) has been detected." (index -3) when video screen reaches my set playback index, no matter what.
I am on version 4.3 build 1057
Is there a workaround besides comparing playbackPosition and playstart?
MattBates
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2012
07:58 AM
Re: End of PlayDuration throws VideoRequestError
Is anyone from Roku going to chime in?
bosborne
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2016
03:04 PM
Re: End of PlayDuration throws VideoRequestError
I'd like to use this feature as well but the fact that it throws an error when the time is up makes it unusable =/
It would be nice to have a separate message type for when the video ends due to this behavior.
Instead I will have to just track the time myself and end the video myself.
It would be nice to have a separate message type for when the video ends due to this behavior.
Instead I will have to just track the time myself and end the video myself.