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

Creating A Live Roku Channel?

I would like to create a live Roku channel that only streams my live TV stream, like a real television station. When you open the channel, I want it to immediately start playing the stream. How do I do this?
0 Kudos
3 REPLIES 3
destruk
Streaming Star

Re: Creating A Live Roku Channel?

For a private channel this would be all you need - replace the url.
For a public channel, Roku wants you to display some contact information if your stream goes down, and add a bit more to it to look nice on failure.



Sub Main()
port=CreateObject("roMessagePort")
screen=CreateObject("roVideoScreen")
screen.SetMessagePort(port)

z=CreateObject("roAssociativeArray")
z.Title="Live Feed"
z.ContentType="episode"
z.ContentQuality="SD"
z.StreamFormat="hls"
z.StreamQualities=[]
z.StreamQualities.Push("SD")
z.StreamBitrates=[]
z.StreamBitrates.Push("0")
z.StreamUrls=[]
z.StreamUrls.Push("http://server/playlist.m3u8") 'stream url

screen.SetContent(z)
screen.Show()
While TRUE
msg=Wait(0,port)
If Type(msg)="roVideoScreenEvent"
If msg.isRequestFailed()
Print"MSG = ";msg.getMessage()
Print"INDEX = ";msg.GetIndex()
Print"TYPE = ";msg.GetType()
Print"DATA = ";msg.GetData()
Print"INFO = ";msg.GetInfo()
Else If msg.isStatusMessage()
Print"Video status: ";msg.GetIndex();" ";msg.GetData()
Else If msg.isButtonPressed()
Print"Button pressed: ";msg.GetIndex();" ";msg.GetData()
Else If msg.isScreenClosed()
Exit While
Else
Print"Unexpected event type: ";msg.GetType()
End If
Else
Print"Unexpected message class: ";Type(msg)
End If
End While
End Sub
0 Kudos
ni23
Visitor

Re: Creating A Live Roku Channel?

Thanks! Does this code include the required parts for a public channel?
0 Kudos
destruk
Streaming Star

Re: Creating A Live Roku Channel?

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.