Solution:
class UserConfig {
</ label="Mute video snaps sound", help="Yes = sound disabled, No = sound enabled", options="Yes,No", order=9 /> mute_videoSnaps="No";
}
###########
## Snaps ##
###########
::OBJECTS1 <- {
artwork_videotheme = fe.add_artwork("snap", x*0.396, y*0.1675, w*0.2085, h*0.510),
}
OBJECTS1.artwork_videotheme.visible=false;
::videoSound <- Vid.NoAudio;
OBJECTS1.artwork_videotheme.video_flags = Vid.NoAudio;
local settings = {
delay_timer = 0,
play_delay = 1600,
stop_play = 235000,
}
function on_transition_videotheme( ttype, var, ttime ) {
switch ( ttype ) {
case Transition.StartLayout:
case Transition.ToNewSelection:
case Transition.ToNewList:
case Transition.EndNavigation:
OBJECTS1.artwork_videotheme.video_flags = Vid.NoAutoStart;
settings.delay_timer = fe.layout.time;
OBJECTS1.artwork_videotheme.visible=false;
break;
}
return false;
}
fe.add_transition_callback( "on_transition_videotheme" );
function on_tick_videotheme(tick_time) {
if ( !OBJECTS1.artwork_videotheme.video_playing && tick_time - settings.delay_timer >= settings.play_delay ) {
OBJECTS1.artwork_videotheme.video_playing = true;
::videoSound <- Vid.Default;
if ( my_config["mute_videoSnaps"] == "Yes")
{
OBJECTS1.artwork_videotheme.video_flags = Vid.NoAudio;
}
if ( my_config["mute_videoSnaps"] == "No")
{
OBJECTS1.artwork_videotheme.video_flags = Vid.Default;
}
OBJECTS1.artwork_videotheme.visible=true;
OBJECTS1.artwork_videotheme.alpha = 0
local alpha_artwork_videotheme_0 = {
property = "alpha", start = 0 end = 255, time = 2000 easing = Easing.Out,
}
animation.add( PropertyAnimation( OBJECTS1.artwork_videotheme, alpha_artwork_videotheme_0 ) );
}
else if ( tick_time - settings.delay_timer >= settings.stop_play ) {
OBJECTS1.artwork_videotheme.visible=false;
}
}
fe.add_ticks_callback(this, "on_tick_videotheme");