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

Loading screen for roscreen

The customvideoplayer program has a function where when a video is loading it will give the percentage loaded, the PaintFramedCanvas () function.



Sub PaintFramedCanvas()
list = []
if m.progress < 100 'Video is currently buffering
list.Push({
Color: "#80000000"
TargetRect: m.layout.left
})
list.Push({
Text: "Loading..." + m.progress.tostr() + "%"
TargetRect: m.layout.left
})
else 'Video is currently playing
if m.paused
list.Push({
Color: "#80000000"
TargetRect: m.layout.left
CompositionMode: "Source"
})
list.Push({
Text: "Paused"
TargetRect: m.layout.left
})
else 'not paused
list.Push({
Color: "#00000000"
TargetRect: m.layout.left
CompositionMode: "Source"
})
end if
list.Push({
Text: "Current position: " + m.position.tostr() + " seconds"
TargetRect: m.layout.bottom
TextAttrs: { halign: "left", valign: "top", color: m.textcolor }
})
end if
m.canvas.SetLayer(1, list)
End Sub


I would like to know how I could do something similar on a roscreen using drawtext to display the information on screen, or if there is an alternative.
0 Kudos
1 REPLY 1
RokuJoel
Binge Watcher

Re: Loading screen for roscreen

You absolutely can do it with roScreen and Drawtext. I'll take a look at porting CustomVideoPlayer to roScreen, I don't expect it to be too difficult, if I can do it quickly, I'll post it here for you.

- Joel
0 Kudos