2021-10-18, 09:11
Hello
My custom skin has the ability to play trailer movies in my view mode. It's working well, but it will take some time to load the container (4-5 seconds).I want to be there in 1-2 seconds
So, I want to get my code reviewed by you guys.
This is my view mode
Container(906).IsUpdating took some times, it normally 4-5 sec or more. Can I reduce time to my container loading time more?
My custom skin has the ability to play trailer movies in my view mode. It's working well, but it will take some time to load the container (4-5 seconds).I want to be there in 1-2 seconds
So, I want to get my code reviewed by you guys.
This is my view mode
xml:
<control type="list" id="903">
<preloaditems>3</preloaditems>
<itemlayout height="240" width="180">
.....
</itemlayout>
<focusedlayout height="240" width="180">
<control type="button">
<description>hidden button to enable youtube container.</description>
<visible allowhiddenfocus="true">false</visible>
<onfocus>SetProperty(videoyoutube,1)</onfocus> : It is hidden button for enable youtube container.
</control>
</focusedlayout>
Variablexml:
<control type="panel" id="906">
<visible>Skin.HasSetting(movie_trailerflag)</visible> : It is flag for movie trailer button
<onload>ClearProperty(ContentVideoYoutube,Home)</onload> :It is just for refresh when I select movie item
<itemlayout height="260" width="160">
....
</itemlayout>
<focusedlayout height="260" width="160">
....
</focusedlayout>
<content limit="1" sortby="file" sortorder="" target="videos">$VAR[ContentVideoYoutube]</content> : to minimize search result, I set limit="1"
</control>
Loading Widget for trailer, This loading widget is showing when Container(906).IsUpdating. It will take 4-5 secxml:
<variable name="ContentVideoYoutube">
<value condition="String.IsEqual(Window.Property(videoyoutube),1) + Skin.HasSetting(movie_trailerflag) + Container.Content(movies)">plugin://plugin.video.youtube/kodion/search/query/?q=$INFO[ListItem.Label]</value>
</variable>
Trailer button has activated when it has focused, When this button has focused , it plays trailer video. It plays very quickly (less than 1-2 sec).xml:
<control type="multiimage">
..
<imagepath>special://skin/spinner/search_widget_loader</imagepath>
<timeperimage>250</timeperimage>
<pauseatend>500</pauseatend>
<colordiffuse>white</colordiffuse>
<fadetime>0</fadetime>
<visible>Container(906).IsUpdating </visible>
..
</control>
My only one problem isxml:
<control type="button" id="9031">
<texturenofocus>special://skin/media/home/trailer.png</texturenofocus>
<texturefocus colordiffuse="$VAR[BackColorButton]">special://skin/media/home/trailer.png</texturefocus>
<onfocus condition="!IsEmpty(ListItem.trailer)">AlarmClock(preview_delay,PlayMedia($ESCINFO[Container(906).ListItem.FileNameAndPath],1),00:00,silent)</onfocus>
<onunfocus condition="System.HasAlarm(preview_delay)">CancelAlarm(preview_delay,silent)</onunfocus>
<onunfocus condition="Control.HasFocus(9031)">stop</onunfocus>
<visible>!Container(906).IsUpdating + Skin.HasSetting(movie_trailerflag)</visible>
</control>
Container(906).IsUpdating took some times, it normally 4-5 sec or more. Can I reduce time to my container loading time more?