Publishing "Old" Custom Image Screensaver w/New Beta Process
Good morning!
Okay wow it's already afternoon. Yikes~
Good afternoon!
I built myself a REAL jank-but-useful screensaver a couple years back that simply shows an image hosted at a particular URL and refreshes every 30 seconds. That's it. Specifically, it's a dynamic link that shows my and my wife's shared calendar via DAKBoard, but still - as far as the app is concerned it's just an image.
I don't think the app itself is having any issues. Here is the code from main.brs just in case I'm missing something, but this has always worked in the past:
Sub RunScreenSaver()
ShowScreenSaver()
End Sub
Sub ShowScreenSaver()
' Works With Images
' facade = CreateObject("roParagraphScreen"
' facade.Show()
' forum mentions facade call is issue
m.canvas = CreateObject("roImageCanvas")
canvas_size = m.canvas.GetCanvasRect()
m.canvas.Show()
while(true)
date = CreateObject("roDateTime")
m.canvas.SetLayer(1,{ url: "https://api.apiflash.com/v1/urltoimage?access_key=MYKEY&format=png&ttl="+(rnd(7200)+21600).toStr()+"&url=https%3A%2F%2Fdakboard.com%2Fapp%2FscreenPredefined%3MY_UID"
' + date.AsSeconds().ToStr()
CompositionMode: "Source"
TargetRect: {x:0,y:0,w:canvas_size.w,h:canvas_size.h}})
' Sleep For 30 Seconds
sleep(300000)
end while
m.canvas.Close()
End Sub
With the new beta channels and ways of signing apps, I just CANNOT get it to work. I mean - it publishes correctly in the Manage My Channels section and makes it onto my local Roku just fine, but when I attempt to launch the screensaver I get Screensaver Not Available with no more specific errors pointing me in the right direction.
Is there something simple I'm missing? An extra step with these new beta channels aside from repackaging with genkey and uploading to My Channels?
Any advice you got, I'll take - thank you!
With the new Roku software version 11.5 you can no longer use any of the components you're using (roParagraphScreen, roImageCanvas). They've been completely removed and you'll get the oh so helpful "Not available" message. It should say "Not compatible".
You need to convert either to Scene Graph or roScreen. Given how simple your screensaver is, roScreen is probably the easiest path, although if you wanted an introduction to Scene Graph it wouldn't be too difficult.
That means that if your main program or currently running channel is based on roScreen it will not be able to create a roScreen as a screensaver. This is annoying and I don't know why that is(still) an issue. I have worked around this by getting the viewers time to screensaver setting and spinning up a scenegraph instance just before the screensaver kicks in and kill the SG instance on screensaver exit... if you don't have a main program you shouldn't need to worry about it. Anyway try this.
function main() screen=CreateObject("roScreen", true, 1280, 720) xrl=CreateObject("roUrlTransfer") xrl.SetUrl("https://upload.wikimedia.org/wikipedia/commons/7/70/Example.png" ) xrl.SetCertificatesFile("common:/certs/ca-bundle.crt")'https requires this xrl.GetToFile( "tmp:/image.png" ) fs=CreateObject("roFileSystem") ?fs.GetDirectoryListing("tmp:/")'see if the image downloaded image=CreateObject("roBitmap", "tmp:/image.png") screen.DrawObject(0, 0, image) Screen.swapbuffers() while true:end while end function
Easier to test as a main program and when you have everything working, change function 'main' to 'runscreensaver'