Author Topic: Help how to solve attractmode "video_time" and "video_duration" bug  (Read 3187 times)

Karlosworkz

  • Sr. Member
  • ****
  • Posts: 103
  • ►►►Games Retrô Dreamâ—„â—„â—„
    • View Profile
Hello everyone, is someone who has knowledge in the squirrel language could help me?
I'm trying to make a command so when the video reaches the end of the execution an animation is made and I didn't have success!
I used the strings: "video_duration" and "video_time" here is the code I am currently using for the count:


///////////////////////////////////////////

local snapt = fe.add_image("Videos/TESTE1.mp4", flx0.0680, fly0.243, flw0.245, flh0.244);
snapt.alpha = 255;
snapt.video_playing = true;
snapt.preserve_aspect_ratio = false;
snapt.zorder = 0;
local dura;
dura = snapt.video_duration; /// total duration of running video

local tempoatual
tempoatual = snapt.video_time;/// current time of the video

function vv( ttime )
{
        dt.msg = snapt.video_time;

}
fe.add_ticks_callback( this, "vv" )

dt <- fe.add_text ( "", flx0.20, fly0.009, flw0.33, flh0.090 );
dt.zorder = 25
dt.align = Align.Centre;
dt.margin = 0;
dt.bg_alpha = 010;

function code ( ttime )
{

          if (tempoatual >= dura)   ///*when the current time of the video is greater than or ///equal to the duration the video will make a command
          {
               snapt.x=flx0.60
          }
}
fe.add_ticks_callback(  "code" )

////////////////////
Silence and a smile are two powerful weapons. The smile solves problems, silence avoids them...

kent79

  • Hero Member
  • *****
  • Posts: 856
    • View Profile
Re: Help how to solve attractmode "video_time" and "video_duration" bug
« Reply #1 on: November 22, 2021, 06:58:23 PM »
http://forum.attractmode.org/index.php?topic=3917.0

You may refer my theme of MENU layout - on_tick function. I think it is the answer

Karlosworkz

  • Sr. Member
  • ****
  • Posts: 103
  • ►►►Games Retrô Dreamâ—„â—„â—„
    • View Profile
Re: Help how to solve attractmode "video_time" and "video_duration" bug
« Reply #2 on: November 23, 2021, 04:17:44 PM »
Thanks bro, I'll look it up in your theme ;D ;D ;D
Silence and a smile are two powerful weapons. The smile solves problems, silence avoids them...