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

roVideoPlayer not showing up.

I have the following code:


Function envivo(episode As Object, codcanal as string )
port = CreateObject("roMessagePort")
http = NewHttp(m.direccion + "roku_envivo.php?codcanal=" + codcanal + "&roku=" + m.idroku)
direccion = http.Http.GetToString()

player = CreateObject("roVideoPlayer")
player.SetMessagePort(port)
player.SetLoop(true)
player.SetPositionNotificationPeriod(1)
player.SetDestinationRect({x: 100, y: 100, w: 280, h: 210})
player.SetContentList([{Stream: { url: "http://ec2-184-72-239-149.compute-1.amazonaws.com:1935/demos/smil:bigbuckbunnyiphone.smil/playlist.m3u8" } }])
player.Play()

contador=1
while true


...but nothing is showing up...no video, no audio, no nothing....can anyone give me a hand?
0 Kudos
1 REPLY 1
RokuChris
Roku Employee
Roku Employee

Re: roVideoPlayer not showing up.

First, you aren't setting the streamFormat attribute of your content-meta-data structure. When that value is omitted, the device defaults to "mp4", but your content is HLS. Second, you generally want to embed a roVideoPlayer in a roImageCanvas and you need to punch a hole in the canvas so you can see the video underneath it...

port = CreateObject("roMessagePort")
http = NewHttp(m.direccion + "roku_envivo.php?codcanal=" + codcanal + "&roku=" + m.idroku)
direccion = http.Http.GetToString()

canvas = CreateObject("roImageCanvas")
canvas.SetLayer(1, { color: "#00000000", compositionMode: "source" })
canvas.Show()

player = CreateObject("roVideoPlayer")
player.SetMessagePort(port)
player.SetLoop(true)
player.SetPositionNotificationPeriod(1)
player.SetDestinationRect({x: 100, y: 100, w: 280, h: 210})
player.SetContentList([{ streamFormat: "hls", Stream: { url: "http://ec2-184-72-239-149.compute-1.amazonaws.com:1935/demos/smil:bigbuckbunnyiphone.smil/playlist.m3u8" } }])
player.Play()

contador=1
while true
0 Kudos