Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
morega
Level 7

HTTPS image url in Poster node

I'm using the sample code provided by Roku SDK. 
In the scene graph xml, I have the following Poster node declared
<Poster id="cover" loadDisplayMode="scaleToZoom"/>




then in the br initialization code I tried to set the ca cert bundle for any https image urls. However, my https images do not show up consistently, but http images show up fine.  Sometimes when I launch the app, no HTTPS images load, and then I relaunch the app, the same images might occur. This seems to happen randomly with the same code ... 
function Init()
   m.cover = m.top.findNode("cover")
   m.cover.SetCertificatesFile("common:/certs/ca-bundle.crt") 
   m.cover.AddHeader("developer ID", "")   
   m.cover.InitClientCertificates()

   m.isLandScapeMode = true
   
   m.itemInfo       = m.top.findNode("itemInfo")
   m.title          = m.top.findNode("title")
   m.description    = m.top.findNode("description")
   m.itemDetails    = m.top.findNode("itemDetails")
   m.backgroundPoster = m.top.findNode("backgroundPoster")
   
   m.cover.observeField("loadStatus", "OnCoverLoadStatusChanged")
 end function



Any ideas?

Thanks!
0 Kudos
3 Replies
EnTerr
Level 8

Re: HTTPS image url in Poster node

The good news is that rOS 7.2 has introduced this:
"HTTPS support is now available for all Scene Graph nodes (roHttpAgent)."

The bad news is that i am not quite clear how this works? In particualr since https://sdkdocs.roku.com/display/sdkdoc/roHttpAgent say that one is already created and set for all roSgNodes already. This is a shot in the dark, but it appears that ifHttpAgent listed to be supported by roSGNode. Now, for the tricky part - both of these combined, it seems to me it should be as easy for you as doing
m.top.SetCertificatesFile("common:/certs/ca-bundle.crt")
m.top.InitClientCertificates()
in the main scene init and in result all your other nodes should start automaGically working with https too!

PS. let me know if that works?
0 Kudos
morega
Level 7

Re: HTTPS image url in Poster node

thanks for the reply. I tried it in HomeScene.brs which is my main scene.

 I simply did what you asked in the init function:
sub init()
    m.top.SetCertificatesFile("common:/certs/ca-bundle.crt")
    m.top.InitClientCertificates()


I'm still not getting thumbnails for the most of time. Like I mentioned before, there are rare times when I relaunch the app and somehow https images started showing, and the next time they don't anymore... All these images I've verified to be working on a desktop browser. 

I wonder if this inconsistency is related to developer mode? 
0 Kudos
morega
Level 7

Re: HTTPS image url in Poster node

actually I just updated the OS to 7.5, now it seems to be working consistently. Thanks for your help!
0 Kudos