2

The below Curl returns an image. I am struggling to find Roku equivalent code to fetch an image and display it in poster node.

curl -X GET \
  https://xiorchestrate-xos-svc.prod.ocean.com:8443/xos/users/ocean-cf0183fb-9e93-4964-859b-XXXXXX/photos/profile \
  -H 'Accept: */*' \
  -H 'Authorization: Bearer XXXXX-9024-44b4-8552-d7d799ec00c8' \
  -H 'cache-control: no-cache'

Can someone help me?

David Buck
  • 3,752
  • 35
  • 31
  • 35
Naren
  • 1,504
  • 16
  • 19

2 Answers2

3

Poster nodes implement the ifHttpAgent interface therefor you should be able to use the SetHeaders(nameValueMap as Object) function before setting the uri to the poster.

m.poster = m.top.createChild("Poster")
m.poster.SetHeaders({"Authorization": "Bearer XXXXX-9024-44b4-8552-d7d799ec00c8", ...})
m.poster.uri = "https://xiorchestrate-xos-svc.prod.ocean.com:8443/xos/users/ocean-cf0183fb-9e93-4964-859b-XXXXXX/photos/profile"
Alejandro Cotilla
  • 2,501
  • 1
  • 20
  • 35
0

You need to make poster node for implementing the image in roku. Create a poster node with <poster /> tag with id and other things like width and height and tranlation, etc,. in xml. After creating the poster node you need to find the node using id with Findnode method in the brs file, like m.poster_id = m.top.findnode("poster_id") here m.poster_id is the glbal variable we initialize for using it for performing another operations. Now, time to set the image uri into the poster node: m.poster_id.uri = "images/image1.png"