Forum Discussion

destruk's avatar
destruk
Streaming Star
13 years ago

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
Else
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.

3 Replies

  • 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.

    --Mark
  • 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?
  • destruk's avatar
    destruk
    Streaming Star
    Thanks Mark! Looks like it's a different one, but I'm not going to lose sleep over it.