Quantcast
Channel: Kodi Community Forum - Skinning
Viewing all articles
Browse latest Browse all 1803

How to make some delay onfocus tag?

$
0
0
Hello

I am working on auto play trailer with button.

Here is my code I have done.

       
<control type="videowindow" id="2">
            <description>Trailer Video Window</description>
            <posx>910</posx>
            <posy>-50</posy>
            <width>70%</width>
            <height>38%</height>
            <visible>Control.HasFocus(9031)</visible>
</control>
<control type="button" id="9031">
             ...
            <texturenofocus>special://skin/media/home/trailer_search.png</texturenofocus>
            <texturefocus colordiffuse="$VAR[BackColorButton]">special://skin/media/home/trailer_search.png</texturefocus>
            <onfocus>PlayMedia($INFO[ListItem.Trailer],1)</onfocus>
            <onunfocus>stop</onunfocus>
            <visible>Skin.HasSetting(movie_trailerflag)</visible>
</control>
When it has focused, it runs play trailer. 

<onfocus>PlayMedia($INFO[ListItem.Trailer],1)</onfocus>

However, it has some time while loading trailer movie(I believe it is scrabed by youtube), so I will give some time to hold play.
Senario what I want
When it stay 1-2 sec on the button, then it will play trailer movie , otherwise, if it move to somewhere(out of button), then it can not play trailer.

It looks like Titan Binge(today version) has done this feature, so I looked over, but it is hard to understand code perfectly.
This code get from titan binge source code.

<onfocus condition="[ControlGroup($PARAM[groupid]).HasFocus() | Control.HasFocus($PARAM[groupid])] + !Player.HasVideo + !String.IsEmpty(ListItem.Trailer) + [String.IsEqual(Skin.String(AutoYoutubeTrailer),true) | !String.Contains(ListItem.Trailer, plugin)] + !String.IsEmpty(Container($PARAM[widgetid]).ListItem.DBID) + !String.IsEqual(Window(Home).Property(LastPlayedTrailer),Container($PARAM[widgetid]).ListItem.DBID)">
            AlarmClock(preview_delay,PlayMedia($ESCINFO[ListItem.Trailer],1),00:$PARAM[interval],silent)</onfocus>
It looks use AlarmClock function, but I can not find 'preview_delay' where has defined in the code. 
It is just my understanding(Please correct me if I am wrong) 

<onfocus>AlarmClock(preview_delay,PlayMedia($ESCINFO[ListItem.Trailer],1),00:$PARAM[interval],silent)</onfocus>
When it has focus, it plays Trailer after $PARAM[interval] sec. Still I don't know what is role of preview_delay.

Viewing all articles
Browse latest Browse all 1803

Trending Articles