Hi
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.
this = {
videoScreen: CreateObject("roPosterScreen")
videoScreenPort: CreateObject("roMessagePort")
videos: video_array
}
this.videoScreen.SetMessagePort(this.videoScreenPort)
this.videoScreen.SetContentList(this.videos)
this.videoScreen.Show()
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 )
metaData = {
Stream: {
Url: video.Url
}
StreamFormat: "mp4"
}
videoScreen.SetContent( metaData )
videoScreen.show()
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.
Any Suggestions would be great