Kodi Community Forum

Full Version: Quick Question: ListItem.IsPlaying ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi I was trying to do a little mod to make it so when you focus an episode thats currently playing in the episode list, instead of its episode thumbnail you get a little videowindow. I thought it'd be simple but I'm having some trouble with ListItem.IsPlaying, maybe I misunderstood its description in the wiki:

Quote:ListItem.IsPlaying - Returns whether the current ListItem.* info labels and images are currently Playing media
I thought that should make it only appear if the focused episode is playing, but it doesn't work, I'm adding this to the views focusedlayout section:

Code:
<control type="videowindow">
                        <posx>13</posx>
                        <posy>13</posy>
                        <width>253</width>
                        <height>139</height>
                        <animation type="Focus" reversible="false">
                        <effect type="zoom" center="127,70" start="50" end="100" time="200" tween="cubic" easing="out" />
                        </animation>
[b]                        <visible>ListItem.IsPlaying</visible>[/b]
                    </control>
Without the visible clause it appears for every episode, playing or not. With it, it never appears. It seems like listitem.isplaying always returns false? or am I using it wrong?

Thanks for reading.
Player.HasVideo
Player.HasAudio
and Player.hasMedia accounts for both...
Thanks but I need it to not only be playing, but be playing the very same episode I currently have focused, as I understand it that's what ListItem.IsPlaying is meant to do but I'm using it wrong or something.
It Probably only works inside the list itself and last I looked video windows don't work inside lists
pastebin

There's a modified ViewsFileMode.xml for confluence. I've tried to add the videowindow to the thumbnail view, if I comment out the visibility clause I get the videowindow everywhere (woah). With the ListItem.IsPlaying it doesn't appear anywhere.

Does listitem.isplaying just not do what I think it does then? Can I maybe do a stringcompare between whats playing now and whats focused to get the same effect?

edit: yep
Quote: <visible>StringCompare(VideoPlayer.Title,ListItem.Title)</visible>
does it, thanks anyway everyone.

Thanks for reading.
Right so from my quick little lest it obviously only works (checks) on the focused item and not unfocused. BUG maybe jmarshall would know better