"destruk" wrote:
Maybe you need to check for a playback failure and then clear the caption for the failed video. Or rather than feeding it an entire content playlist, feed it one caption and one video at a time until the list is completed.
currentvideo=0 'initialize counter -- maybe this isn't necessary but it is here for legibility so I know later it will be an integer and what it is used for
....event loop....
else if type(msg) = "roVideoPlayerEvent"
If msg.isrequestfailed()
errormessage=msg.info()
playlist=videoPlayer.GetContentList()
for x=0 to playlist.count()-1
If errormessage.url=playlist[X].stream.url then 'once bad stream has been found, no need to search for it so break out of the for loop
currentvideo=X
exit for
end if
next
for x=0 to currentvideo 'it failed so delete everything that has already played as well as current video that tried to play
playlist.delete[X]
next
if playlist.count()>0 'if there are items left to play
videoPlayer.SetContentList(playlist)
videoPlayer.Show() 'might not be necessary, but show the screen again to restart the videos with the altered new playlist
end if
end if
"destruk" wrote:
I would think something like this would work for your situation, still using the playlist -
I haven't tested it but the logic makes sense to me.
currentvideo=0 goes before your event loop starts for the video player (in the video player routine)
The code in the event loop goes into your event loop for the video player routine.
currentvideo=0 'initialize counter -- maybe this isn't necessary but it is here for legibility so I know later it will be an integer and what it is used for
....event loop....
else if type(msg) = "roVideoPlayerEvent"
If msg.isrequestfailed()
errormessage=msg.info()
playlist=videoPlayer.GetContentList()
for x=0 to playlist.count()-1
If errormessage.url=playlist[X].stream.url then 'once bad stream has been found, no need to search for it so break out of the for loop
currentvideo=X
exit for
end if
next
for x=0 to currentvideo 'it failed so delete everything that has already played as well as current video that tried to play
playlist.delete[X]
next
if playlist.count()>0 'if there are items left to play
videoPlayer.SetContentList(playlist)
videoPlayer.Show() 'might not be necessary, but show the screen again to restart the videos with the altered new playlist
end if
end if
"destruk" wrote:
If you need it to loop (always something, right?) then rather than deleting everything up to the point of failure in the playlist, you could remove just the failed item, track what item was removed, and reset the playlist followed by SetNext to restart where it left off with the next piece of valid content.
http://sdkdocs.roku.com/display/sdkdoc/ ... egerasVoid
SetNext(item as Integer) as Void
Set what the next item to be played within the Content List should be.
I'd still recommend deleting the entire piece of bad content so the number of subtitle urls that are valid will match up with the number of valid video urls - as that seems to be the problem for the rovideoplayer/rocaption
We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. Read more here.
Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 19th and you may notice reduced functionality.
In the meantime, for additional assistance, visit our Support Site.
We're sorry for this disruption — we’re excited to share what’s next!