Kodi Community Forum

Full Version: Can I add a condition without having to use a variable?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Guys,

I'm trying to play a movie trailer automatically when a movie information is displayed (DialogVideoInfo.xml). The code below works well, however, I'd like to include a condition to this to only play if a trailer is available.

PHP Code:
<onload>AlarmClock(PlayTrailer,PlayMedia($INFO[ListItem.Trailer],false,1),00:02,silent)</onload

As I have TVTunes addon enabled, the code above stops playing any theme tune playing in the background when loading a TV episode's information. I'd like to know if it's possible to include a condition without using a variable include. Is this possible at all?

Would appreciate any help. Thanks!
Code:
<onload condition="!IsEmpty(ListItem.Trailer)">...</onload>


About the TVTunes thing, you can use this condition to check if theme is playing:
Code:
IsEmpty(Window(10025).Property(PlayingBackgroundMedia))
(2016-02-05, 17:46)tomer953 Wrote: [ -> ]
Code:
<onload condition="!IsEmpty(ListItem.Trailer)">...</onload>


About the TVTunes thing, you can use this condition to check if theme is playing:
Code:
IsEmpty(Window(10025).Property(PlayingBackgroundMedia))

Tomer953, you are a star, I could come and kiss you right now Big Grin Thank you SO much, this was exactly what I needed and the TVTunes thing is a bonus.


Thanks once again