My channel is based on the video player sample.
I’d like a category to have a play all button, but I’m struggling with brightscript in general.
My understanding is roVideoscreen won’t work, as that won’t play a playlist.
I also can’t figure out how to grab all the videos from my xml and play them as a a playlist, or how to make a special button that launches a player. Any help would be much appreciated!
Thank you so much. This is amazing.
So this adds a play all button on an episode level page?
This is fantastic. Works great. Thank you very much!
2 issues, in case anyone else wants to use this.
- Play All is an option for the last episode, which is unnecessary as it doesn’t (and probably shouldn’t) loop.
I think the trick is in here:
if showlist.count() > 1 then
screen.addbutton(3,"Play All")
end if
- Once the last episode is finished, the channel needs to be restarted before anything else can be played again. I’m still looking for clues on that one.
I am trying to implement this code, but I am having an issue with the “playback interrupted by user.” situation.
When I use the code as written in the example, if the playback is interrupted, I get a “type mismatch” here:
if type(event) = "roVideoScreenEvent" then
if event.getmessage()= "Playback interrupted by user." then
return "user cancelled playback"
end if
It breaks on the return. I am sort of a noob on the rules of a function returning things, so originally I rewrote my app to avoid having to do this. That resulted in, you guessed it, a recursive situation that caused a stack overflow after about 30 videos.
If I can figure out how to handle this last item, i will have a “play all” function that actually even loops the playlist over and over.
Any help would be appreciated