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: 
dreamer2057
Channel Surfer

EPG Grid Example

Anybody has an example of EPG Grid?

I want to customize (or use as it) this:
https://sdkdocs.roku.com/display/sdkdoc/EPGGrid
Sincerely, Sergey Shoshin, software developer.
0 Kudos
4 REPLIES 4
dreamer2057
Channel Surfer

Re: EPG Grid Example

I found an example. On the fifth page. Thanks to edskitter

viewtopic.php?f=34&t=88621&start=60

"edskitter" wrote:
epgGridScene.xml
<?xml version="1.0" encoding="utf-8" ?> 

<!--********** Copyright 2015 Roku Corp. All Rights Reserved. **********-->

<component name="epgGridScene" extends="Scene">

<script type="text/brightscript" >

</script>

<children>
<!-- EPG Grid -->
<customEPGGrid />
</children>
</component>


EpgGrid.xml
<?xml version="1.0" encoding="utf-8" ?> 

<component name="customEPGGrid" extends="EPGGrid" >

<script type="text/brightscript" >

<![CDATA[

function init()
print "inside epg"
m.content = createObject("RoSGNode","ContentNode")
m.top.setFocus(true)

dateNow = CreateObject("roDateTime")
dateNow = dateNow.asSeconds() - 2000

addChannel("ABC")
addItem("ABC Show ", dateNow)


addChannel("CBS")
addItem("CBS Show ", dateNow)

addChannel("NBC")
addItem("NBC Show ", dateNow)


addChannel("NICK")
addItem("NICK Show ", dateNow)

addChannel("OUTSIDE")
addItem("Outside Show ", dateNow)

addChannel("TEST")
addItem("Test Show ", dateNow)

m.top.content = m.content
m.top.translation = [50, 300]
m.top.numRows = 5
m.top.duration = 10800
m.top.nowNextMode = false
m.top.infoGridGap = 0
m.top.channelInfoColumnLabel = "Hello"

end function

sub addChannel(channelText as string)
m.channel = m.content.createChild("ContentNode")
m.channel.TITLE = channelText
m.channel.HDSMALLICONURL = "http://css.boshanka.co.uk/wp-content/uploads/2015/04/icon-logo-design-small.png"
end sub

sub addItem(progText as string, timeStart)
For i=0 To 5 Step 1
program = m.channel.createChild("ContentNode")
program.TITLE = progText + str(i)
program.PLAYSTART = timeStart + (i * 2000)
program.PLAYDURATION = "2000"
End For

end sub

]]>

</script>
</component>


main.brs
'********** Copyright 2015 Roku Corp.  All Rights Reserved. **********

sub Main()
showChannelSGScreen()
end sub

sub showChannelSGScreen()
print "in showChannelSGScreen"
screen = CreateObject("roSGScreen")
m.port = CreateObject("roMessagePort")
screen.setMessagePort(m.port)
scene = screen.CreateScene("epgGridScene")
screen.show()

while(true)

msg = wait(0, m.port)
msgType = type(msg)

if msgType = "roSGScreenEvent"

if msg.isScreenClosed()
print "screen closed"
return
end if

end if

end while
end sub


I can get the EPG to render but I can not get the grid to have focus to move up / down / left / right. What am I missing?
Sincerely, Sergey Shoshin, software developer.
0 Kudos
Vignesh
Visitor

Re: EPG Grid Example

I am currently using EPG Grid based on your example. But I need to do some customizations in the EPG Grid (i.e)

How to hide blue colour vertical time line bar in the grid ? &

How to center align the Channel Logo in the First column?
0 Kudos
xoceunder
Roku Guru

Re: EPG Grid Example

"dreamer2057" wrote:
I found an example. On the fifth page. Thanks to edskitter

viewtopic.php?f=34&t=88621&start=60

"edskitter" wrote:
epgGridScene.xml
<?xml version="1.0" encoding="utf-8" ?> 

<!--********** Copyright 2015 Roku Corp.  All Rights Reserved. **********-->

<component name="epgGridScene" extends="Scene">

<script type="text/brightscript" >

</script>

<children>
<!-- EPG Grid -->
<customEPGGrid />
</children>
</component>


EpgGrid.xml
<?xml version="1.0" encoding="utf-8" ?> 

<component name="customEPGGrid" extends="EPGGrid" >

<script type="text/brightscript" >

<![CDATA[

function init()
print "inside epg"
m.content = createObject("RoSGNode","ContentNode")
m.top.setFocus(true)

dateNow = CreateObject("roDateTime")
dateNow = dateNow.asSeconds() - 2000

addChannel("ABC")
addItem("ABC Show ", dateNow)


addChannel("CBS")
addItem("CBS Show ", dateNow)

addChannel("NBC")
addItem("NBC Show ", dateNow)


addChannel("NICK")
addItem("NICK Show ", dateNow)

addChannel("OUTSIDE")
addItem("Outside Show ", dateNow)

addChannel("TEST")
addItem("Test Show ", dateNow)

m.top.content = m.content
m.top.translation = [50, 300]
m.top.numRows = 5
m.top.duration = 10800
m.top.nowNextMode = false
m.top.infoGridGap = 0
m.top.channelInfoColumnLabel = "Hello"

end function

sub addChannel(channelText as string)
 m.channel = m.content.createChild("ContentNode")
 m.channel.TITLE = channelText
 m.channel.HDSMALLICONURL = "http://css.boshanka.co.uk/wp-content/uploads/2015/04/icon-logo-design-small.png"
end sub

sub addItem(progText as string, timeStart)
 For i=0 To 5 Step 1
   program = m.channel.createChild("ContentNode")
  program.TITLE = progText + str(i)
  program.PLAYSTART = timeStart + (i * 2000)
  program.PLAYDURATION = "2000"
End For
 
end sub

]]>

</script>
</component>


main.brs
'********** Copyright 2015 Roku Corp.  All Rights Reserved. **********

sub Main()
showChannelSGScreen()
end sub

sub showChannelSGScreen()
print "in showChannelSGScreen"
screen = CreateObject("roSGScreen")
m.port = CreateObject("roMessagePort")
screen.setMessagePort(m.port)
scene = screen.CreateScene("epgGridScene")
screen.show()

while(true)

msg = wait(0, m.port)
msgType = type(msg)

if msgType = "roSGScreenEvent"

if msg.isScreenClosed()
print "screen closed"
return
end if

end if

end while
end sub


I can get the EPG to render but I can not get the grid to have focus to move up / down / left / right. What am I missing?


How can i get a link list with your epg and select to play the video
0 Kudos

Re: EPG Grid Example

How i can use this code to make My EPG using XMl feed or JSON Feed
0 Kudos