tutash
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2017
09:30 AM
Images not loading consistently into PosterGrid
I'm using posterGrid and not markupGrid. This is a requirement of the code I'm writing. So, with that out of the way:
I create content nodes to populate a posterGrid, then set said grid's content to be that content node. This is normal stuff. For testing, I'm fetching the images from either a local server, or a CDN.
Sometimes, when checking my server logs, I'll see a request for an image (for the posterGrid) twice, and this is when I'm seeing the error. The image doesn't load, and even though I've defined failedBitmapUri for the posterGrid, this image does not show, and isn't even called (nothing in the server logs).
I see the same/similar behaviour when loading images from our CDN.
Since I'm using posterGrid, I can't find a way to observe any loadStatus from the posterGrids contents.
Any idea what is happening here?
Why is the posterGrid functioning so poorly?
Any insight into this problem would be greatly appreciated.
I create content nodes to populate a posterGrid, then set said grid's content to be that content node. This is normal stuff. For testing, I'm fetching the images from either a local server, or a CDN.
Sometimes, when checking my server logs, I'll see a request for an image (for the posterGrid) twice, and this is when I'm seeing the error. The image doesn't load, and even though I've defined failedBitmapUri for the posterGrid, this image does not show, and isn't even called (nothing in the server logs).
I see the same/similar behaviour when loading images from our CDN.
Since I'm using posterGrid, I can't find a way to observe any loadStatus from the posterGrids contents.
Any idea what is happening here?
Why is the posterGrid functioning so poorly?
Any insight into this problem would be greatly appreciated.
5 REPLIES 5
joetesta
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2017
04:35 PM
Re: Images not loading consistently into PosterGrid
what are the file sizes of your images?
aspiring
tutash
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2017
07:19 AM
Re: Images not loading consistently into PosterGrid
File sizes are 6-7k. There are 16 of them.
tutash
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2017
07:49 AM
Re: Images not loading consistently into PosterGrid
I've found that if I run a routine like:
After a routine like this, the images will load when the content node is applied to PosterGrids. This doesn't remove the subsequent requests to the server from the now populated posterGrid, but it does mean that they don't fail to load. I'm not sure why this works, but it does.
sub prefetchImages(array as Object)
print array.count()
preloader = createObject("RoSGNode","Group")
for i = 0 to array.count()-1
if type(array[i]) = "roString" then
image = createObject("RoSGNode","Poster")
image.uri = array[i]
preloader.appendChild(image)
print array[i]
end if
end for
print "PREFETCH SET"
m.scene.content = m.content
print "CONTENT SET"
for i = 0 to array.count()-1
item = preloader.getChild(i)
item = invalid
preloader.removeChild(i)
end for
preloader = invalid
print "PREFETCH REMOVED"
end sub
After a routine like this, the images will load when the content node is applied to PosterGrids. This doesn't remove the subsequent requests to the server from the now populated posterGrid, but it does mean that they don't fail to load. I'm not sure why this works, but it does.
Veeta
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2017
09:00 AM
Re: Images not loading consistently into PosterGrid
Tutash, what other requests may be happening at the same time the postergrid is loading? I've found failures when i load up too many visible items at once and it seems to hit a threshold for simultaneous network requests.
tutash
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2017
01:34 PM
Re: Images not loading consistently into PosterGrid
Veeta,
I'm getting that feeling as well. I'll try staggering the population of renderable objects over time to see if I can improve loading performance.
I'm getting that feeling as well. I'll try staggering the population of renderable objects over time to see if I can improve loading performance.