I have a list of mp4 videos that has to be played one after another. For a certain category of mp4 videos, I am using "roPosterScreen" to display all the videos and "roVideoScreen" to play my videos. Once the user starts playing the video, I would like to play all the videos in that category one after the another without stopping, like a playlist.
I kind of partly achieved it but the problem is once every video is complete, it goes back to "roPosterScreen" video list screen and soon starts the next video. Between every video there is a flicker of previous screen before it moves to second video. I have to close the "roVideoScreen" for each video and open it again for the next, this should be the reason. I have copied major part of my code below.
while(true) msg = wait(0,this.videoScreenPort) if (type(msg) = "roPosterScreenEvent") if (msg.IsListItemSelected()) For index = msg.GetIndex() To this.videos.count()-1 Step +1 PlayVideo(this.videos[index]) End For ...
Function PlayVideo(video as object) as integer videoScreen = CreateObject("roVideoScreen") port = CreateObject("roMessagePort") videoScreen.SetMessagePort( port )
while (true) msg = wait(0, port) if type(msg) = "roVideoScreenEvent" if (msg.isScreenClosed()) return -1 else if msg.isFullResult() print "playback completed" exit while end if endif end while End Function
I checked ROKU samples for "roVideoPlayer" where it can play a playlist but it lacks the user control that I would like in my videos.