How does one use Playlist.Position?
#1
Hello, I'm trying to use fanart as the background on the loading screen.  I'm currently using
 
Code:
$INFO[Player.Art(fanart)]
This works fine, but only once the video starts playing.  There's some delay going on due to transcoding, so I'd like to pull the fanart from the playlist instead.

I was expecting
 
Code:
$INFO[Container(50).ListItemPosition($INFO[Playlist.Position]).Art(fanart)]
to get me there, but I'm not getting anything to show up. 
Code:
$INFO[System.CurrentControlID]
indicates I should have the right ID.  So far, I'm unable to get Container(any-id) to show anything, so I'm clearly doing something wrong.

Could some skinning gurus point me in the right direction?  Thanks.
Reply
#2
I've taken a short look at GUIInfoManager.cpp.  It looks like what I actually want may be VideoPlayer.offset(1).Art(fanart), but offset() does not appear to be working with art().

An aside: Fanart.Image is currently not on the wiki.
Reply
#3
(2021-08-06, 21:30)jessbo Wrote: An aside: Fanart.Image is currently not on the wiki.

I see it now, at the bottom.  I'd edit it out of the post, but don't see an edit button.

Also just saw commit #18410, "Add offset/position support to Player.* infolabels".  So it's just Art() not working with offset(), I guess?  The closest I've been able to get is $INFO[Player.offset(1).Cover], which isn't quite what I'm looking for.

If there's some other way to accomplish this, feel free to point me in the right direction.
Reply
#4
And now for the exciting (?) conclusion.  I was never able to get the information I wanted out of the infolabels, but was able to access it via Python (and presumably the JSON-API, if one was so inclined).

I created a little script that gathers the info and writes it as a property of the home window.  Here's an incomplete snippet.  Hopefully some future person finds it useful.
 
Code:
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
pos = playlist.getposition()
    if pos == -1:
        # On the video playlist, use ListItem for position
        if xbmcgui.getCurrentWindowId() == WINDOW_VIDEOPLAYLIST:
            pos = int(xbmc.getInfoLabel('ListItem.CurrentItem')) - 1

listitem = playlist[pos + offset]
artwork = listitem.getArt('fanart') or listitem.getArt('thumb')

For the sake of testing, I had this debug code:
 
Code:
infotags = listitem.getVideoInfoTag()
title = infotags.getTitle()
tvshow = infotags.getTVShowTitle()
log(f'python: {tvshow} - {title} - {fanart} / {thumb}')

title = xbmc.getInfoLabel('VideoPlayer.Position({pos + offset}).Title')
tvshow = xbmc.getInfoLabel('VideoPlayer.Position({pos + offset}).TvShowTitle')
fanart = xbmc.getInfoLabel('VideoPlayer.Position({pos + offset}).Art(Fanart)')
thumb = xbmc.getInfoLabel('VideoPlayer.Position({pos + offset}).Art(Thumb)')
log(f'infolabel: {tvshow} - {title} - {fanart} / {thumb}')

The "python" line worked fine, but the "infolabel" line never output any artwork.  Not sure if I'm doing it wrong.  Regardless, I was able to chain together my little script, some keymappings, and the skin to accomplish my goal.

The end.

Credits roll:
...
...

Post-credits trailer:
...
...

Fin.
Reply

Logout Mark Read Team Forum Stats Members Help
How does one use Playlist.Position?0