Forum Discussion

ajitg_4557's avatar
ajitg_4557
Channel Surfer
8 years ago

how to show base64 encoded image in poster node.

I am facing problem to show base64 image to poster node.
please guys help us on this issue.


sub load_Map(json As Object)

json=parseJSON(json)
remove_n=json.MapFlightResult
print"remove Before========>>>>"remove_n

r = CreateObject("roRegex","\n", "i")
remove_new=r.ReplaceAll(remove_n,"")
print"remove After========>>>>"remove_new


ba=CreateObject("roByteArray")
ba.FromBase64String(remove_new)
img=ba.ToAsciiString()
print"img=======>>>>>"img
m.Map.uri=img
m.Map.visible=true

end sub

thanks in advance to All Roku Team.

3 Replies

  • You're looking for something like this:

    uri = "tmp:/images/" + someidentifier
    ba = CreateObject("roByteArray")
    ba.fromBase64String(yourbase64string)
    ba.writeFile(uri)

    poster.uri = uri
  • What I do for the sake of speed is write an external php script to handle the code as Roku gets bogged down real quick.
  • ajitg_4557's avatar
    ajitg_4557
    Channel Surfer
    Hi,Smith
    i still hang on this issue,can you please elaborate more on this.