Conditional Visability Questions?
#1
i am trying to display media flags in the seekbar, i have them working, but the issue i have is trying to get kodi to tell the difference between playing a trailer file vs playing a movie file.

currently i am using:

Code:
<visible>!String.Containsl(Player.Filename,movie-trailer) + Window.IsVisible(seekbar) | !String.Contains(Player.Filename,movie-trailer) + Window.IsVisible(fullscreeninfo) | !String.Contains(Player.Filename,movie-trailer) + Window.IsVisible(VideoOSD)</visible>

but it only seems to catch when i play the trailer the second time.

trailers are named movie-trailer.mp4 annd each is in the respective movie folder

IE:

Code:
    <control type="image" id="1">
                <top>805</top>
                <left>1020</left>
                <width>60</width>
                <height>40</height>
                <animation effect="slide" end="0,-75" time="200" condition="Window.IsVisible(VideoOSD)">Conditional</animation>
                <textcolor>$VAR[TextColor1]</textcolor>
                <texture>$VAR[VideoSourceFlag]</texture>
                <visible>!String.IsEqual(Player.Filename,movie-trailer) + Window.IsVisible(seekbar) | !String.Contains(Player.Filename,movie-trailer) + Window.IsVisible(fullscreeninfo) | !String.Contains(Player.Filename,movie-trailer) + Window.IsVisible(VideoOSD)</visible>
           </control>

and it's Variable:

Code:
    <!--Video Source Flag-->
    <variable name="VideoSourceFlag">
        <value condition="[String.Contains(Player.Filename,Blu-ray.)]">flags/bluray.png</value>
        <value>$INFO[Player.Filename]</value>
    </variable>

the first play of a trailer the blu-ray flag is visible, but if i stop it and play it again, it is not visible.

is there a better way to tell if kodi is playing a trailer?
Reply
#2
(2020-03-29, 19:16)spl147 Wrote: i am trying to display media flags in the seekbar, i have them working, but the issue i have is trying to get kodi to tell the difference between playing a trailer file vs playing a movie file.

currently i am using:

Code:
<visible>!String.Containsl(Player.Filename,movie-trailer) + Window.IsVisible(seekbar) | !String.Contains(Player.Filename,movie-trailer) + Window.IsVisible(fullscreeninfo) | !String.Contains(Player.Filename,movie-trailer) + Window.IsVisible(VideoOSD)</visible>

but it only seems to catch when i play the trailer the second time.

trailers are named movie-trailer.mp4 annd each is in the respective movie folder

IE:

Code:
    <control type="image" id="1">
                <top>805</top>
                <left>1020</left>
                <width>60</width>
                <height>40</height>
                <animation effect="slide" end="0,-75" time="200" condition="Window.IsVisible(VideoOSD)">Conditional</animation>
                <textcolor>$VAR[TextColor1]</textcolor>
                <texture>$VAR[VideoSourceFlag]</texture>
                <visible>!String.IsEqual(Player.Filename,movie-trailer) + Window.IsVisible(seekbar) | !String.Contains(Player.Filename,movie-trailer) + Window.IsVisible(fullscreeninfo) | !String.Contains(Player.Filename,movie-trailer) + Window.IsVisible(VideoOSD)</visible>
           </control>

and it's Variable:

Code:
    <!--Video Source Flag-->
    <variable name="VideoSourceFlag">
        <value condition="[String.Contains(Player.Filename,Blu-ray.)]">flags/bluray.png</value>
        <value>$INFO[Player.Filename]</value>
    </variable>

the first play of a trailer the blu-ray flag is visible, but if i stop it and play it again, it is not visible.

is there a better way to tell if kodi is playing a trailer?

could you potentially do it based on the length of the file, i.e. if duration is less than 180seconds its probably a trailer and probably not anything else.

But it should be fine just to do it on the file name, does it work if you add the square brackets around your OR statements? Or condense it down to:

xml:
<visible>!String.Containsl(Player.Filename,movie-trailer) + [Window.IsVisible(seekbar) | Window.IsVisible(fullscreeninfo) | Window.IsVisible(VideoOSD)]</visible>
Reply
#3
Can you explain a bit more what's happening here? In your variable, what is supposed to show when the value is equal to Player.Filename?
Reply
#4
(2020-03-29, 23:01)QuizKid Wrote: Can you explain a bit more what's happening here? In your variable, what is supposed to show when the value is equal to Player.Filename?

if the Player.Filename is equal to movie-trailer it should not show the bluray logo
Reply
#5
(2020-03-29, 22:51)QuizKid Wrote: could you potentially do it based on the length of the file, i.e. if duration is less than 180seconds its probably a trailer and probably not anything else.

But it should be fine just to do it on the file name, does it work if you add the square brackets around your OR statements? Or condense it down to:

xml:
<visible>!String.Containsl(Player.Filename,movie-trailer) + [Window.IsVisible(seekbar) | Window.IsVisible(fullscreeninfo) | Window.IsVisible(VideoOSD)]</visible>
 
the above does not work any different then what i had before. it works on the second play of the file, but not the first

duration sounds interesting, but not sure howto format it
Reply
#6
Is it easier in that case to say that if your file name includes Blu-ray it should show the bluray logo and forget about the movie-trailer filenames and the variable altogether? Unless it is also achieving something that I'm not realising... 

xml:

<control type="image" id="1">
    <top>805</top>
    <left>1020</left>
    <width>60</width>
    <height>40</height>
    <animation effect="slide" end="0,-75" time="200" condition="Window.IsVisible(VideoOSD)">Conditional</animation>
    <textcolor>$VAR[TextColor1]</textcolor>
    <texture>flags/bluray.png</texture>
    <visible>String.Contains(Player.Filename,Blu-ray)</visible>
</control>
Reply
#7
(2020-03-29, 23:17)QuizKid Wrote: Is it easier in that case to say that if your file name includes Blu-ray it should show the bluray logo and forget about the movie-trailer filenames and the variable altogether? Unless it is also achieving something that I'm not realising... 

xml:

<control type="image" id="1">
    <top>805</top>
    <left>1020</left>
    <width>60</width>
    <height>40</height>
    <animation effect="slide" end="0,-75" time="200" condition="Window.IsVisible(VideoOSD)">Conditional</animation>
    <textcolor>$VAR[TextColor1]</textcolor>
    <texture>flags/bluray.png</texture>
    <visible>String.Contains(Player.Filename,Blu-ray)</visible>
</control>
ok, so i tried this:

xml:

<control type="image" id="1">
    <top>805</top>
    <left>1020</left>
    <width>60</width>
    <height>40</height>
    <animation effect="slide" end="0,-75" time="200" condition="Window.IsVisible(VideoOSD)">Conditional</animation>
    <textcolor>$VAR[TextColor1]</textcolor>
    <texture>flags/bluray.png</texture>
    <visible>String.Contains(Player.Filename,Blu-ray) + [Window.IsVisible(seekbar) | Window.IsVisible(fullscreeninfo) | Window.IsVisible(VideoOSD)]</visible>
    <visible>!Window.IsVisible(DialogSettings.xml) + !Window.IsVisible(playerprocessinfo) + !Window.IsVisible(DialogSelect.xml)</visible>
</control>

still shows on first play but not if replayed
Reply
#8
You've got a typo - you've written "Containsl" not "Contains"
!String.Containsl(Player.Filename,movie-trailer)

Also you should use Player.FileNameAndPath
i.e.
Code:
!String.Contains(Player.FileNameAndPath,movie-trailer)
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply

Logout Mark Read Team Forum Stats Members Help
Conditional Visability Questions?0