Forum Discussion

p2premote's avatar
p2premote
Visitor
14 years ago

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.

8 Replies

  • 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
  • '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.
  • 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
  • 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**********************************
  • 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?
  • 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.
  • isPlaybackPosition and isStreamStarted both work with HLS.

    Are you calling SetPositionNotificationPeriod() on your roVideoScreen? If you don't, isPlaybackPosition will not fire.
  • Thank you Chris!

    Yes I did not call SetPositionNotificationPeriod, and it works after I added it.