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: 
destruk
Streaming Star

AudioPlayer combined with Gridscreen 'BUG'

If you populate a gridscreen, and the selected item uses roAudioPlayer, when you add content to the audioplayer it changes the graphics for the gridscreen to square, and creates black lines between the overhanglogo and the bottom of the screen. Moving the selection box around kind of 'fixes the icons' on a row basis, but doesn't restore the screen. This also happens if you load the audioplayer component and add content to it on a springboard screen on top of the gridscreen. It's kind of weird when it happens - so I guess the way to avoid the problem would be to go back to closing the gridscreen before adding content, and then recreating the gridscreen when you're done with the audioplayer?
0 Kudos
4 REPLIES 4
destruk
Streaming Star

Re: AudioPlayer combined with Gridscreen 'BUG'

Code to recreate --


Sub Main()
Gridscreen()
End Sub

Sub Gridscreen()
port=CreateObject("roMessagePort")
grid=CreateObject("roGridScreen")
grid.SetMessagePort(port)
rowTitles=CreateObject("roArray",10,TRUE)
For j=0 To 10
rowTitles.Push("[Row Title "+j.toStr()+" ] ")
Next
grid.SetupLists(rowTitles.Count())
grid.SetListNames(rowTitles)
For j=0 To 10
list=CreateObject("roArray",10,TRUE)
For i=0 To 10
o=CreateObject("roAssociativeArray")
o.ContentType="episode"
o.Title="[Title"+i.tostr()+"]"
o.ShortDescriptionLine1="[ShortDescriptionLine1]"
o.ShortDescriptionLine2="[ShortDescriptionLine2]"
o.Description=""
o.Description="[Description] "
o.Rating="NR"
o.StarRating="75"
o.ReleaseDate="[<mm/dd/yyyy]"
o.Length=5400
o.Actors=[]
o.Actors.Push("[Actor1]")
o.Actors.Push("[Actor2]")
o.Actors.Push("[Actor3]")
o.Director="[Director]"
list.Push(o)
Next
grid.SetContentList(j,list)
Next
grid.Show()

While TRUE
msg=Wait(0,port)
If type(msg)="roGridScreenEvent"
If msg.isScreenClosed()
Exit While
Else If msg.isListItemFocused()
Print"Focused msg: ";msg.GetMessage();"row: ";msg.GetIndex();
Print" col: ";msg.GetData()
Else If msg.isListItemSelected()

'problem is caused by this, or any combination of springboard screen on top of gridscreen, etc etc

audioPlayer=CreateObject("roAudioPlayer")
audioPlayer.SetMessagePort(port)
item=CreateObject("roAssociativeArray")
item.Url="" '''any item can go here, makes no difference if it's a valid url or not
item.StreamFormat=("mp3")
audioPlayer.AddContent(item) ' this is the problem line to screw up the gridscreen display

Print"Selected msg: ";msg.GetMessage();"row: ";msg.GetIndex();
Print" col: ";msg.GetData()
Else If msg.isRemoteKeyPressed()
Print"Button Pressed msg: ";msg.GetIndex()
End If
End If
End While
Return
End Sub
0 Kudos
maihde
Visitor

Re: AudioPlayer combined with Gridscreen 'BUG'

I've seen similar oddities with GridScreen on both the 2.9 and 3.0 firmware.

In my particular case, the main screen is an roGridScreen. Selecting an item goes to a spring board during which then plays audio using a background roAudioPlayer. You can then press the "Up" button to go back to the grid screen while the audio continues to play. Everything goes okay until the track is over and the roAudioPlayer switches to the next track. At this point the grid screen "flashes black" and then it is drawn incorrectly. In my case I'm already using the square grid screen, so what happens is the bottom 20% of the screen is all black and each grid is about 3/4 filled in with icons.

Also, for what it's worth, there are also known issues when other screens are stacked on top of a grid screen.
viewtopic.php?f=34&t=37984&p=247904&hilit=gridscreen#p247904
0 Kudos
hastinbe
Newbie

Re: AudioPlayer combined with Gridscreen 'BUG'

I am having the same issue as the OP. Just the mere creation of an roAudioPlayer object causes the gridscreen to glitch.
0 Kudos
RokuJoel
Binge Watcher

Re: AudioPlayer combined with Gridscreen 'BUG'

Best is to store all the data for your grid-screen in an array of arrays, destroy the grid screen when launching any other screens, and recreate it from the array when closing the other screen.

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