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

Live Canvas not appearing when integrating with grid

Hello,

I have a grid application where I am making the first row of the grid a live feed. It is currently a search screen, with code in appmain like this:

' Display the search screen
Function displaySearchScreen()
...setup and display search window
end function

To test my implementation, I took the custom video player example and copied the code into appmain, right below the displaySearchScreen function above. Then, I changed the RunUserInterface sub in the example code (now pasted into appMain) take the place of the code in the displaySearchScreen function. My grid still shows Search as the option, but when I choose it, the audio from the live feed starts to play - the screen is blank. Pressing the down arrow, as suported in the custom video player example, produces the full screen video. Another down arrow scales the video to the window in the custom video player canvas, but my canvas does not display.

The code for the display of the canvas is, I believe:

Sub SetupFramedCanvas()
m.canvas.AllowUpdates(false)
m.canvas.Clear()
m.canvas.SetLayer(0, [
{ 'Background:
Url: m.background
CompositionMode: "Source"
},
{ 'The title:
Text: "Custom Video Player"
TargetRect: m.layout.top
TextAttrs: { valign: "bottom", font: m.headerfont, color: m.textcolor }
},
{ 'Help text:
Text: m.help
TargetRect: m.layout.right
TextAttrs: { halign: "left", valign: "top", color: m.textcolor }
}
])
m.paint()
m.canvas.AllowUpdates(true)
End Sub

I was expecting the m.paint() statement to produce the canvas, but it does not. The event loop does appear to be working however. What should I be looking for? Any assistance appreciated.
0 Kudos
1 REPLY 1
powerfinger
Visitor

Re: Live Canvas not appearing when integrating with grid

ok - I guess I had to copy the backHD and backSD to the image folder so the command would have something to display. Good thing there is a no such thing as a stupid question, huh?

Thanks for reading...
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.