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: 
jvalero
Visitor

Best way to listen for end of video with roVideoPlayer

What is the best/easiest way to listen for the end of a single video in the roVideoPlayer playlist? It seems isFullResult() only fires at the the very end of the playlist. Also how can I gain access to attributes (meta data) of the current item being played?
0 Kudos
4 REPLIES 4
jvalero
Visitor

Re: Best way to listen for end of video with roVideoPlayer

I figured it out. I was hoping to just use a built in event, but it does not seem that one fires at the end of a video in the playlist. So what I did was:

'// Set Index to 0 to mirror playing from the start of the playList
currentIndex = 0

'// Code to setup roVideoPlayer and Event Loop Here ...

'// Event Listener for Position
If msg.isPlaybackPosition() Then

index = msg.GetIndex()

If index.tostr() = playList[currentIndex].Length

currentIndex = currentIndex + 1

'// Do something

End If

End If
0 Kudos
RokuJoel
Binge Watcher

Re: Best way to listen for end of video with roVideoPlayer

msg.isfullresult() should give you the end of playback.

- Joel
0 Kudos
jvalero
Visitor

Re: Best way to listen for end of video with roVideoPlayer

No, it doesn't seem to fire as expected. I haven't tested it, but I think it will fire at the end of the playlist. I could be wrong, but it does not fire at the end of each item in the playlist.
0 Kudos
TheEndless
Channel Surfer

Re: Best way to listen for end of video with roVideoPlayer

I think you should get an "end of stream" status message in the IsStatusMessage() event. There may also be an undocumented IsRequestSucceeded() event. I've found that quite a few of the documented roAudioPlayerEvents are also present in the roVideoPlayer, even though they're not documented as such.
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)
0 Kudos