Auto trailers
#1
Hi guys. I need some help. I'm trying to fix auto trailers. The problem is that he doesn't play every trailer when the movie is focused, it's plays every second, third movie trailer. And I found where the problem was. This is the code for this function.

Code:
<include name="Bingie_Default_AutoPreview">
        <include content="Bingie_Trailer_Action" condition="Skin.HasSetting(BingieAutoTrailer)">
        <param name="interval" value="$INFO[Skin.String(main_auto_trailer_interval)]" />
        <param name="widgetid" value="$PARAM[widgetid]" />
        <param name="groupid" value="$PARAM[groupid]" />
        </include>
        <onfocus condition="!String.IsEmpty(Window(Home).Property(KeepPlayingPreview))">ClearProperty(KeepPlayingPreview,Home)</onfocus>
        <onunfocus condition="System.HasAlarm(preview_delay)">CancelAlarm(preview_delay,silent)</onunfocus>
        <onunfocus condition="$EXP[IsPlayingUnrecognizedContent] + String.IsEmpty(Window(Home).Property(KeepPlayingPreview))">PlayerControl(Stop)</onunfocus>
    </include>
Code:
<include name="Bingie_Trailer_Action">
        <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>
        <onfocus condition="[ControlGroup($PARAM[groupid]).HasFocus() | Control.HasFocus($PARAM[groupid])] + !Player.HasVideo + String.IsEmpty(ListItem.Trailer) + String.IsEqual(ListItem.DBType,movie) + String.IsEqual(Skin.String(AutoYoutubeTrailer),true) + !String.IsEmpty(Container($PARAM[widgetid]).ListItem.DBID) + !String.IsEmpty(Container($PARAM[widgetid]).ListItem.DBID) + !String.IsEqual(Window(Home).Property(LastPlayedTrailer),Container($PARAM[widgetid]).ListItem.DBID)">
            AlarmClock(preview_delay,RunScript(script.bingie.helper,action=playtrailer,title=$INFO[ListItem.Title]),00:$PARAM[interval],silent)</onfocus>
        <onfocus condition="[ControlGroup($PARAM[groupid]).HasFocus() | Control.HasFocus($PARAM[groupid])] + !Player.HasVideo + Skin.HasSetting(AllowTVShowsTrailer) + !String.IsEmpty(Container($PARAM[widgetid]).ListItem.DBID) + [String.IsEqual(ListItem.DBType,tvshow) | String.IsEqual(ListItem.DBType,episode)] + !String.IsEqual(Window(Home).Property(LastPlayedTrailer),Container($PARAM[widgetid]).ListItem.DBID)">
            AlarmClock(preview_delay,RunScript(script.bingie.helper,action=playtrailer,title=$VAR[TVShowTitle],tvshow=true,youtube=$INFO[Skin.String(AutoYoutubeTrailer)]),00:$PARAM[interval],silent)</onfocus>
        <onfocus condition="[ControlGroup($PARAM[groupid]).HasFocus() | Control.HasFocus($PARAM[groupid])] + !Player.HasVideo + Skin.HasSetting(AllowAddonTrailer) + String.IsEqual(Skin.String(AutoYoutubeTrailer),true) + String.IsEmpty(Container($PARAM[widgetid]).ListItem.DBID) + [String.IsEqual(ListItem.DBType,movie) | String.IsEqual(ListItem.DBType,tvshow) | String.IsEqual(ListItem.DBType,episode)] + !String.IsEqual(Window(Home).Property(LastPlayedTrailer),Container($PARAM[widgetid]).ListItem.Label)">
            AlarmClock(preview_delay,RunScript(script.bingie.helper,action=playtrailer,title=$INFO[ListItem.Title]),00:$PARAM[interval],silent)</onfocus>
        <onfocus condition="!String.IsEmpty(Container($PARAM[widgetid]).ListItem.DBID)">SetProperty(LastPlayedTrailer, $INFO[Container($PARAM[widgetid]).ListItem.DBID],Home)</onfocus>
        <onfocus condition="String.IsEmpty(Container($PARAM[widgetid]).ListItem.DBID)">SetProperty(LastPlayedTrailer, $ESCINFO[Container($PARAM[widgetid]).ListItem.Label],Home)</onfocus>
    </include>

These two lines serve to prevent the trailer from running again after the trailer is finished. Of course they are put in a condition to tell the alarm not to play the trailer again. But those lines also make a problem because when I delete them, the trailers work properly.

Code:
<onfocus condition="!String.IsEmpty(Container($PARAM[widgetid]).ListItem.DBID)">SetProperty(LastPlayedTrailer, $INFO[Container($PARAM[widgetid]).ListItem.DBID],Home)</onfocus>
<onfocus condition="String.IsEmpty(Container($PARAM[widgetid]).ListItem.DBID)">SetProperty(LastPlayedTrailer, $ESCINFO[Container($PARAM[widgetid]).ListItem.Label],Home)</onfocus>

Code:
!String.IsEqual(Window(Home).Property(LastPlayedTrailer),Container($PARAM[widgetid]).ListItem.DBID)

But there is another problem then. Trailers without these lines go in a loop and are constantly repeated, which should not be the case. How can I stop the constant repetition of the trailer when the movie is in focus without causing me a problem when playing the next trailer, that is, to play it normally. Thanks in advance for the help.
Reply
#2
Anyone?
Reply

Logout Mark Read Team Forum Stats Members Help
Auto trailers0