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

HTTPS Issue

I am loading a hls manifest from a https source. I can confirm using roUrlTransfer that the source does exists and is accessible. Further down the script, I attempt to load the same url but using an actual roVideoScreen object (in order to play the video). But the debug output keeps stating: "handshakefailed". This is my code can anyone spot the problem? I have redacted the urls

sub Main()
?"Starting Application"

streamUrl = "https://hls-encodes.[redacted URL].mp4/hls.m3u8"

port = CreateObject("roMessagePort")
screen=CreateObject("roScreen", true)
screen.SetAlphaEnable(true)
screen.SetMessagePort(port)

ut = CreateObject("roUrlTransfer")
'ut.SetCertificatesFile("pkg:/certs/AddTrustExternalCARoot.crt")
ut.SetCertificatesFile("common:/certs/ca-bundle.crt")
ut.setUrl(streamUrl)
?ut.getToString()

player = CreateObject("roVideoPlayer")
player.SetCertificatesFile("common:/certs/ca-bundle.crt")
player.AddHeader("X-Roku-Reserved-Dev-Id", "")
player.SetMessagePort(port)
player.SetLoop(false)

player.SetContentList([{
StreamFormat: "hls"
Streams: [{url: streamUrl}]
}])

' debugging
syslog = CreateObject("roSystemLog")
syslog.SetMessagePort(port)
syslog.EnableType("http.error")
syslog.EnableType("http.connect")

?"Start Play"
screen.clear(&h00000000)
screen.swapBuffers()
player.Play()

while true
?"Looping ..."
msg = wait(0, port)

if type(msg) = "roVideoPlayerEvent" then
print "msg = "; msg.getMessage() " | index = "; msg.GetIndex()
elseif type(msg) = "roSystemLogEvent" then
?"System Log Event"
info = msg.getInfo()
?info
else
print "Unexpected message class: "; type(msg)
end if
end while


end sub
0 Kudos
1 REPLY 1
RokuJoel
Binge Watcher

Re: HTTPS Issue

It looks like you are missing the InitClientCertificates() method for both roUrlTransfer and roVideoPlayer.

- Joel
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.