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

Problem with the mixed-aspect-ratio grid - LoadingPoster

Hi,
I am using mixed-aspect-ratio grid screen for one of the pages of my app, i am using two kinds of poster style for different rows( portrait and landscape ), the problem is with the initial rendering.

In my case i have total of 6 rows, initial 3 rows are posters and final 3 rows are landscacpe, the problem is with the initial LoadingPoster which comes in where the 4th, 5th and 6th rows are all poster styles of landscape but the LoadingPoster which is been loaded is the portrait one.

I have tried using SetLoadingPoster function, but it also doesn't define poster style for portrait and landscape, according to my understanding SetLoadingPoster is a generic function which is applied over the whole mixed-aspect-ratio screen which includes both portrait and landscape. how do we solve this problem?

attached are the screenshots of the problem described above.
1st screen shot : screenshot showing mixed aspect ratio implementation (poster and landscape poster style)
https://drive.google.com/file/d/0B9SpvR28Va-mUjYxcThxcGJJTkU/view?usp=sharing

2nd screen shot: screenshot shows overlapping of LoadingPoster from one landscape poster on to another
https://drive.google.com/file/d/0B9SpvR28Va-mN3d4TUl5aW1Sc00/view?usp=sharing

hoping for a quick resolution

Thanks,
Ramakanth.G
0 Kudos
6 REPLIES 6
TheEndless
Channel Surfer

Re: Problem with the mixed-aspect-ratio grid - LoadingPoster

That definitely looks like a bug. I've never seen that and use the mixed-aspect-ratio grid in quite a few channels. What model Roku and what firmware version are you running?
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
RokuJoel
Binge Watcher

Re: Problem with the mixed-aspect-ratio grid - LoadingPoster

Probably you should post some of the code used to set up and display your grid - I've never seen that behavior before either. Be sure to use the Code tag for readability.

- Joel
0 Kudos
ramakanth
Visitor

Re: Problem with the mixed-aspect-ratio grid - LoadingPoster

Here is the whole code for that screen, Please suggest if i am doing something wrong or it's bug in the platform itself.

function CreateMovieListingScreen(asset_type as String)

gridstyle = "mixed-aspect-ratio"
screenFacade=preShowMovieGridScreen(gridstyle)

screenFacade.show()

showMovieGridScreen(screenFacade, gridstyle, asset_type)

end function


Function preShowMovieGridScreen(style as string) As Object

m.movie_port=CreateObject("roMessagePort")
movie_screen = CreateObject("roGridScreen")
movie_screen.SetMessagePort(m.movie_port)
movie_screen.SetDisplayMode("scale-to-fill")

movie_screen.SetGridStyle(style)
'movie_screen.SetLoadingPoster("", "pkg:/images/Content_Tile_HD.png")
return movie_screen

End Function


Function showMovieGridScreen(screen As Object, gridstyle as string, asset_type as String) As string
movie_list_titles = ["Hollywood", "Jazwood", "Bollywood", "Genres", "Audio Language", "Subtitles"]
movie_list_params = ["hollywood", "jazwood", "bollywood"]
movie_list_sec_count = []
movie_list_genre_count = []
movie_list_audio_lang_count = []
movie_list_sub_lang_count = []
movie_list_items = CreateObject("roArray", 3, true)
movie_row_items = CreateObject("roArray", 3, true)
movie_row_items_holder = []
movie_row_style_list = []

tile_color = "31353B"

screen.setupLists(movie_list_titles.count())
screen.SetBreadcrumbEnabled(true)
brd_text = ""
if asset_type = "movie"
brd_text = "Movies"
else if asset_type = "tv_series"
brd_text = "TV Shows"
end if

subStatus = ""
if isUserLoggedin() = true
subStatus = getSubscriptionStatus()
end if

screen.SetBreadcrumbText("Home", brd_text)
screen.SetListNames(movie_list_titles)

for cnt = 0 to movie_list_titles.Count() -1
if movie_list_titles[cnt] <> "Genres"
movieList = getSearchList("eng",invalid,"0","10",movie_list_params[cnt],asset_type,invalid,invalid,invalid)
if movieList <> invalid
movie_list_items.Push(movieList)
if cnt = 0
movie_list_sec_count = movieList.facets.sections
movie_list_genre_count = movieList.facets.categories
movie_list_audio_lang_count = movieList.facets.audio_languages
movie_list_sub_lang_count = movieList.facets.subtitles_languages

sub_count = 0
for each slang in movie_list_sub_lang_count
if slang.iso_639_3 = "ara"
movie_list_sub_lang_count.Delete(sub_count)
end if
sub_count = sub_count + 1
end for
end if
else
print "internet connection problem"
ShowConnectionFailed()
return ""
end if
else
end if
end for

if movie_list_items.Count() > 2
for mcnt = 0 to movie_list_titles.Count() -1
movie_row_items.Clear()

lCount = 0
for each section in movie_list_sec_count
if movie_list_params[mcnt] = section.id
lCount = section.count
end if
end for

iCount = 0
if movie_list_titles[mcnt] <> "Genres" and movie_list_titles[mcnt] <> "Audio Language" and movie_list_titles[mcnt] <> "Subtitles"
movie_row_items[lCount-1] = invalid
movie_row_items_holder[mcnt] = []
movie_row_items_holder[mcnt][lCount-1] = invalid
for each asset in movie_list_items[mcnt].items
obj = CreateObject("roAssociativeArray")
mYear = itostr(asset.year)
obj.Title = asset.title
obj.Description = asset.description
hdposter = ""
sdposter = ""
for each image in asset.images
if image.type = "poster"
hdposter = image.link+"/192x274"
sdposter = image.link+"/140x180"
'print hdposter
end if
end for
obj.HDPosterUrl = hdposter
obj.SDPosterUrl = sdposter
obj.releaseDate = getYearData(asset.vod_model,subStatus,mYear,itostr(asset.duration))
obj.length = asset.duration
'movie_row_items.push(obj)
movie_row_items[iCount] = obj
movie_row_items_holder[mcnt][iCount] = obj
iCount = iCount+1
end for
movie_row_style_list.Push("portrait")
else if movie_list_titles[mcnt] = "Genres"
for each genre in movie_list_genre_count
obj = CreateObject("roAssociativeArray")
'obj.Title = genre.title
'obj.Description = asset.description
hdposter = "http://placeholdit.imgix.net/~text?txtsize=22&w=192&h=144&bg=" +tile_color+"&txtclr=fff&txtfont=bold&txt="+genre.title
sdposter = "http://placeholdit.imgix.net/~text?txtsize=22&w=140&h=94&bg=" +tile_color+"&txtclr=fff&txtfont=bold&txt="+genre.title
obj.HDPosterUrl = hdposter
obj.SDPosterUrl = sdposter
movie_row_items.push(obj)
end for
movie_row_style_list.Push("landscape")
else if movie_list_titles[mcnt] = "Audio Language"
for each alang in movie_list_audio_lang_count
atitle = ""
for each alang_iso_name in m.AvailableLangs
if alang_iso_name.iso_639_3 = alang.iso_639_3
atitle = alang_iso_name.name
end if
end for
obj = CreateObject("roAssociativeArray")

'obj.Title = atitle
'obj.Description = asset.description
hdposter = "http://placeholdit.imgix.net/~text?txtsize=22&w=192&h=144&bg=" +tile_color+"&txtclr=fff&txtfont=bold&txt="+atitle
sdposter = "http://placeholdit.imgix.net/~text?txtsize=22&w=140&h=94&bg=" +tile_color+"&txtclr=fff&txtfont=bold&txt="+atitle
obj.HDPosterUrl = hdposter
obj.SDPosterUrl = sdposter
movie_row_items.push(obj)
end for
movie_row_style_list.Push("landscape")
else if movie_list_titles[mcnt] = "Subtitles"
for each slang in movie_list_sub_lang_count
stitle = ""
for each sub_iso_name in m.AvailableLangs
if sub_iso_name.iso_639_3 = slang.iso_639_3
stitle = sub_iso_name.name
end if
end for

obj = CreateObject("roAssociativeArray")
'obj.Title = stitle
'obj.Description = asset.description
hdposter = "http://placeholdit.imgix.net/~text?txtsize=22&w=192&h=144&bg=" +tile_color+"&txtclr=fff&txtfont=bold&txt="+stitle
sdposter = "http://placeholdit.imgix.net/~text?txtsize=22&w=140&h=94&bg=" +tile_color+"&txtclr=fff&txtfont=bold&txt="+stitle
obj.HDPosterUrl = hdposter
obj.SDPosterUrl = sdposter
movie_row_items.push(obj)
end for
movie_row_style_list.Push("landscape")
end if
if movie_row_items.count() = 0
screen.SetListVisible(mcnt, false) ' Hide Empty Row
end if
screen.SetContentList(mcnt, movie_row_items)
end for
screen.SetListPosterStyles(movie_row_style_list)

while true
print "Waiting for message"
msg = wait(0, m.movie_port)
print "Got Message:";type(msg)
if type(msg) = "roGridScreenEvent" then
if msg.isListItemFocused() then
print"list item focused | current show = "; msg.GetData()
'data = movie_list_items[msg.GetIndex()]
row = msg.GetIndex()
selection = msg.GetData()
if movie_list_titles[row] <> "Genres" and movie_list_titles[row] <> "Audio Language" and movie_list_titles[row] <> "Subtitles"
screen.SetDescriptionVisible(true)
if row < 0 OR row >= movie_list_titles.Count() then
' Debug("Ignoring grid ListItemFocused event for bogus row: " + tostr(msg.GetIndex()))
else
if movie_row_items_holder[row][selection] = invalid or movie_row_items_holder[row][selection+1] = invalid or movie_row_items_holder[row][selection+2] = invalid or movie_row_items_holder[row][selection+3] = invalid or movie_row_items_holder[row][selection+4] = invalid
print "call the loadmore for row" ;row
LoadMoreContent(screen,row,selection,movie_row_items_holder[row],movie_list_items[row],asset_type,movie_list_params[row],subStatus)
else
print "there is some data for row" ;row
end if
end if
else
screen.SetDescriptionVisible(false)
end if

else if msg.isListItemSelected() then
row = msg.GetIndex()
selection = msg.getData()
print "list item selected row= "; row; " selection= "; selection
if movie_list_titles[row] = "Genres"
CreateFilterScreen(movie_list_genre_count[selection], asset_type, invalid, invalid, "Genres")
else if movie_list_titles[row] = "Audio Language"
CreateFilterScreen(invalid, asset_type, movie_list_audio_lang_count[selection].iso_639_3, invalid, "Audio Language")
else if movie_list_titles[row] = "Subtitles"
CreateFilterScreen(invalid, asset_type, invalid, movie_list_sub_lang_count[selection].iso_639_3, "Subtitles")
else if asset_type = "movie"
showSpringboardScreen(movie_list_items[row].items[selection], invalid)
else if asset_type = "tv_series"
createSeasonsScreen(movie_list_items[row].items[selection])
end if
else if msg.isScreenClosed() then
return ""
end if
end if
end while
else
return ""
end if

End Function
0 Kudos
ramakanth
Visitor

Re: Problem with the mixed-aspect-ratio grid - LoadingPoster

Roku Model : 4200X - Roku 3
Software Version : Version 6.2 build 3672

Thanks,
Ramakanth.G
0 Kudos
ramakanth
Visitor

Re: Problem with the mixed-aspect-ratio grid - LoadingPoster

Here is one more observation of mine, in our home screen to i am using mixed aspect ratio - square posters for menu, landscape for screen shot images and portrait for movie tiles.

The problem I am seeing again here is with the landscape tiles in this case the row is the continue watching. here is the screenshot of how it appears in the initial launch
https://drive.google.com/file/d/0B9SpvR28Va-mMUpZU2tPMm5JRDQ/view?usp=sharing

Once I scrolled down and come back(up scroll), it tries to scale to portrait mode - even if it is defined as landscape
https://drive.google.com/file/d/0B9SpvR28Va-mNDJUNUhaNEdqYnM/view?usp=sharing

Once i go to any other screen (in this flow i went to movies screen) and come back to home screen it actually works
https://drive.google.com/file/d/0B9SpvR28Va-mWHRXY3Vxc3ZDYk0/view?usp=sharing

here is the expected output in initial launch which i am able to see after switching to any other screen and pressing back the screen looks settled.
https://drive.google.com/file/d/0B9SpvR28Va-mTE9lRllOZFhnYmc/view?usp=sharing

can you please explain me the reason behind this, looks like this is a bug I have tried with even square poster type and found similar kind of problem, i have tried with all the display modes scale-to-fill, scale-to-fit, zoom-to-fill and photo-fit, every try has given me the same result of image getting distorted in case of scale to fill image was getting into portrait mode even we define it as either landscape or square.

but in all the above cases once i got to any other screen and come back the (landscape or square images) get settled down as show in the screen shot.
https://drive.google.com/file/d/0B9SpvR28Va-mTE9lRllOZFhnYmc/view?usp=sharing

please let me know if there is any kind of refresh which can be done - the process of switching to other screen and coming back , is there any kind of refresh which is happening?

Thanks,
Ramakanth.G
0 Kudos
ramakanth
Visitor

Re: Problem with the mixed-aspect-ratio grid - LoadingPoster

Hi Joel,
Is it a bug with the platform or I am doing something wrong, can you please advice, we are near to the release of our app to Roku app store, Can you please clarify on this.

Thanks,
Ramakanth.G
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.