Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Binge Watcher

How do you discover unexpected event types?

Just curious in the debugger - videos play, the channel app works fine, but I keep seeing prints for unexpected event type: 0 0 ?
When this happens, msg.getType returns "0", msg.getData is "0", msg.getIndex is "0", msg.getMessage is nothing, type(msg) is "roVideoPlayerEvent"

My code handles (alphabetized)
If msg<>invalid
If msg.isButtonPressed()
Else If msg.isFullResult()
Else If msg.isPartialResult()
Else If msg.isPaused()
Else If msg.isPlaybackPosition()
Else If msg.isRemoteKeyPressed()
Else If msg.isRequestFailed()
Else If msg.isResumed()
Else If msg.isScreenClosed()
Else If msg.isStatusMessage()
Else If msg.isStreamStarted() 'simply present to prevent a meaningless error message
Print"Unexpected event type: ";msg.GetMessage()
End If
End If

So which "roVideoPlayerEvent" am I missing?
It doesn't break anything leaving it like it is - from the docs - "If you receive an unknown event in your event loop, you should ignore it; then just continue processing other events. Roku may occasionally add new events, and if your event is written to exit on unknown events, any future events that Roku may add will cause your application to misbehave." - I just want to know what this new event message is for.
0 Kudos

Re: How do you discover unexpected event types?

The only VideoPlayer event I see that you're missing is isStreamSegmentInfo. The info AA has members Sequence, SegUrl, StreamBandwidth and SegStartTime. This may not be documented.

0 Kudos
Channel Surfer

Re: How do you discover unexpected event types?

I'm pretty sure isStreamSegmentInfo isn't available in the 3.x firmware, so checking for it could cause a crash unless it's the last one in your If...Then checks, so it should never be reached.

Mark, any chance of getting the event type 7, mentioned in your post here (viewtopic.php?f=34&t=48575&p=331515#p331515), added so we can determine the length of a video without having to have it explicitly in the metadata?
My Channels: - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
Binge Watcher

Re: How do you discover unexpected event types?

Thanks Mark! Looks like it's a different one, but I'm not going to lose sleep over it.
0 Kudos