Your Digital Media Has Never Looked So Good

 
katycorp
Topic Author
Posts: 21
Joined: Tue Nov 09, 2010 3:42 pm
Contact:

End of PlayDuration throws VideoRequestError

Wed Mar 23, 2011 9:05 am

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
 
User avatar
TheEndless
** Valued Community Member **
Posts: 9231
Joined: Mon Oct 04, 2004 10:15 am
Location: US
Contact:

Re: End of PlayDuration throws VideoRequestError

Wed Mar 23, 2011 4:19 pm

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)
 
katycorp
Topic Author
Posts: 21
Joined: Tue Nov 09, 2010 3:42 pm
Contact:

Re: End of PlayDuration throws VideoRequestError

Mon May 23, 2011 12:31 pm

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
 
User avatar
RokuMarkn
Roku Engineering
Posts: 1581
Joined: Mon Jun 09, 2008 9:20 am

Re: End of PlayDuration throws VideoRequestError

Mon May 23, 2011 1:58 pm

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
 
katycorp
Topic Author
Posts: 21
Joined: Tue Nov 09, 2010 3:42 pm
Contact:

Re: End of PlayDuration throws VideoRequestError

Tue May 24, 2011 10:33 am

I just upgraded yesterday and am still seeing the same behavior. (version 3, build 2191)
 
katycorp
Topic Author
Posts: 21
Joined: Tue Nov 09, 2010 3:42 pm
Contact:

Re: End of PlayDuration throws VideoRequestError

Tue May 24, 2011 11:03 am

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
 
User avatar
RokuKevin
Roku Engineering
Posts: 796
Joined: Tue Sep 22, 2009 2:29 pm

Re: End of PlayDuration throws VideoRequestError

Thu May 26, 2011 2:20 pm

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
 
MattBates
Posts: 8
Joined: Mon Apr 02, 2012 10:45 am

Re: End of PlayDuration throws VideoRequestError

Mon Apr 02, 2012 10:49 am

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?
 
MattBates
Posts: 8
Joined: Mon Apr 02, 2012 10:45 am

Re: End of PlayDuration throws VideoRequestError

Mon Apr 09, 2012 7:58 am

Is anyone from Roku going to chime in?
 
bosborne
Posts: 141
Joined: Wed Jun 06, 2012 10:42 am

Re: End of PlayDuration throws VideoRequestError

Sun Sep 04, 2016 3:04 pm

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.

Who is online

Users browsing this forum: No registered users and 5 guests