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.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
p2premote
Visitor

Why 'Video status' event is not firing?

I am interested seeing video status event to know if the video has started playing, but it looks like the event is not being fired.

In RokuSDK_v41/examples/source/videoplayer/source/appVideoScreen.brs, it has:

if type(msg) = "roVideoScreenEvent" then
print "showHomeScreen | msg = "; msg.getMessage() " | index = "; msg.GetIndex()
if msg.isScreenClosed()
print "Screen closed"
exit while
...
elseif msg.isStatusMessage()
print "Video status: "; msg.GetIndex(); " " msg.GetData()

But when running the example on my roku box, I have never seen the status message. For example, the following is copied from telnet:
url: http://rokudev.roku.com/rokudev/example ... tivity.xml
Request Time: 60
Show Feed Parse Took : 21
ButtonPressed
ButtonPressed
showHomeScreen | msg = Stream started. | index = 1
Unexpected event type: 20
showHomeScreen | msg = | index = 0
showHomeScreen | msg = Playback interrupted by user. | index = 0
Unexpected event type: 15
showHomeScreen | msg = | index = 0
Screen closed
Button pressed: 2 0

The video plays fine, but I have not seen any '"Video status' message.

Thanks.
0 Kudos
8 REPLIES 8
RokuJoel
Binge Watcher

Re: Why 'Video status' event is not firing?

showHomeScreen | msg = Stream started. | index = 6

That IS a status message

While it is playing you will see this:

showHomeScreen | msg = | index = 60

where the index is the position in seconds in the video.

- Joel
0 Kudos
p2premote
Visitor

Re: Why 'Video status' event is not firing?

'Stream started' is a different event. The video is not showing on the screen when 'stream started'. It looks like roku starts to download the video when this event happens, but normally it takes a few more seconds of buffering before the video starts to play.

I am interested in the event that can tell me if the video is actually showing up on the screen.
0 Kudos
RokuJoel
Binge Watcher

Re: Why 'Video status' event is not firing?

This appears to be what you get when the image actually first shows on the screen:

?"message:";msg.getmessage();" Type:";msg.gettype();" Index:"; msg.getindex();" data:";msg.getdata()

message: Type: 6 Index: 0 data: 0

so msg.gettype() returns 6, which is the same as what msg.isplaybackposition() would give you, in otherwords, you get a playback position of 0 with a message type 6.

- Joel
0 Kudos
RokuJoel
Binge Watcher

Re: Why 'Video status' event is not firing?

To expand on that a little bit:

if type(msg) = "roVideoScreenEvent" then
?"******************************************MESSAGE**********************************"
?"message:";msg.getmessage();" Type:";msg.gettype();" Index:"; msg.getindex();" data:";msg.getdata();" playback pos? ";msg.isplaybackposition()
?"******************************************MESSAGE**********************************"


Output when video shows:

******************************************MESSAGE**********************************
message: Type: 6 Index: 0 data: 0 playback pos? true
******************************************MESSAGE**********************************
0 Kudos
p2premote
Visitor

Re: Why 'Video status' event is not firing?

Thanks. I saw the event with type 6 for mp4.

But I am not able to see any status for HLS stream. The only even I saw is 'stream starts'. Is there a way to tell if the video starts playing for HLS stream?
0 Kudos
p2premote
Visitor

Re: Why 'Video status' event is not firing?

I tried many ways, still not able to see status message for http live streaming (hls).

Any one knows if it is possible? If it is not available now, I highly recommend Roku to add one, there are lots of creative things people can do while video is buffering.
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: Why 'Video status' event is not firing?

isPlaybackPosition and isStreamStarted both work with HLS.

Are you calling SetPositionNotificationPeriod() on your roVideoScreen? If you don't, isPlaybackPosition will not fire.
0 Kudos
p2premote
Visitor

Re: Why 'Video status' event is not firing?

Thank you Chris!

Yes I did not call SetPositionNotificationPeriod, and it works after I added it.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.