Author Topic: Add loading video  (Read 3094 times)

qqplayer

  • Sr. Member
  • ****
  • Posts: 245
    • View Profile
Add loading video
« on: January 24, 2017, 09:19:57 AM »
« Last Edit: January 27, 2017, 05:29:35 AM by qqplayer »

keilmillerjr

  • Hero Member
  • *****
  • Posts: 583
    • View Profile
Re: Adding loading video
« Reply #1 on: January 24, 2017, 12:30:35 PM »
Make sure your layer is top most and just toggle visibility or opacity for fade.

qqplayer

  • Sr. Member
  • ****
  • Posts: 245
    • View Profile
Re: Adding loading video
« Reply #2 on: January 24, 2017, 12:38:49 PM »
Make sure your layer is top most and just toggle visibility or opacity for fade.

Yes , but the thing is , AM starts playing the mp4 file when starts the layout , not when I launch the game.
It plays on the background even with opacity 0.
So when it fades in , can be playing on second 1 or second 20 its totally random.

I need a function or wathever to start the video only when I launch the game not before.

keilmillerjr

  • Hero Member
  • *****
  • Posts: 583
    • View Profile
Re: Adding loading video
« Reply #3 on: January 24, 2017, 12:50:46 PM »
Make sure your layer is top most and just toggle visibility or opacity for fade.

Yes , but the thing is , AM starts playing the mp4 file when starts the layout , not when I launch the game.
It plays on the background even with opacity 0.
So when it fades in , can be playing on second 1 or second 20 its totally random.

I need a function or wathever to start the video only when I launch the game not before.

You need to stop and the video from playing and then have it start playing when during your transition. See layout.md. If you still have trouble, put your code in the post and I'll look at it when I get out from work.

qqplayer

  • Sr. Member
  • ****
  • Posts: 245
    • View Profile
Re: Adding loading video
« Reply #4 on: January 24, 2017, 01:08:24 PM »
Make sure your layer is top most and just toggle visibility or opacity for fade.

Yes , but the thing is , AM starts playing the mp4 file when starts the layout , not when I launch the game.
It plays on the background even with opacity 0.
So when it fades in , can be playing on second 1 or second 20 its totally random.

I need a function or wathever to start the video only when I launch the game not before.

You need to stop and the video from playing and then have it start playing when during your transition. See layout.md. If you still have trouble, put your code in the post and I'll look at it when I get out from work.

I made this:

Code: [Select]
{
local basebar = fe.add_image( "loading/basebar.mp4", 0, 0, flw, flh );
basebar.alpha=0;

local alphabase_cfg = {
    when = Transition.ToGame,
    property = "alpha",
    start = 0,
    end = 255,
    time = 100
    delay = 1000
}
animation.add( PropertyAnimation( basebar, alphabase_cfg ) );

local hidebase_cfg = {
    when = Transition.FromGame,
    property = "alpha",
    start = 255,
    end = 0,
    time = 100
    wait = true
}
animation.add( PropertyAnimation( basebar, hidebase_cfg ) );

}

Maybe using video_flags (Vid.NoAutoStart) but I want to autoplay my videosnaps.

keilmillerjr

  • Hero Member
  • *****
  • Posts: 583
    • View Profile
Re: Adding loading video
« Reply #5 on: January 24, 2017, 02:33:29 PM »
I have no idea how to use the animation module.

You need to add the following:
basebar.video_flags = Vid.NoAutoStart;
baseball.video_flags = Vid.NoLoop;

You could create a separate transition callback to enable video_playing, and then another to disable it again. But all this can be achieved without using the animation module and only using transition and tick callbacks.

qqplayer

  • Sr. Member
  • ****
  • Posts: 245
    • View Profile
Re: Adding loading video
« Reply #6 on: January 24, 2017, 02:53:30 PM »
I have no idea how to use the animation module.

You need to add the following:
basebar.video_flags = Vid.NoAutoStart;
baseball.video_flags = Vid.NoLoop;

You could create a separate transition callback to enable video_playing, and then another to disable it again. But all this can be achieved without using the animation module and only using transition and tick callbacks.
Pleas , I need more help , pasted this and still autoplaying:

Code: [Select]
local basebar = fe.add_image( "loading/basebar.mp4", 0, 0, flw, flh );
basebar.alpha=0;
basebar.video_flags = Vid.NoAutoStart;
basebar.video_flags = Vid.NoLoop;

keilmillerjr

  • Hero Member
  • *****
  • Posts: 583
    • View Profile
Re: Adding loading video
« Reply #7 on: January 24, 2017, 03:50:57 PM »
I think I made a mistake. Try
basebar.video_flags = Vid.NoAutoStart | Vid.NoLoop;

qqplayer

  • Sr. Member
  • ****
  • Posts: 245
    • View Profile
Re: Adding loading video
« Reply #8 on: January 24, 2017, 06:00:26 PM »
Yeah, I tried this too ,but now video doestn start when I launch a game.
Seems to need another extra function to start playing.Any ideas?

jedione

  • Hero Member
  • *****
  • Posts: 525
  • punktoe
    • View Profile
Re: Adding loading video
« Reply #9 on: January 24, 2017, 06:35:14 PM »
is this what you want

http://forum.attractmode.org/index.php?topic=1081.0

would show a demo but "bandicam" records is all F-up....dont't know why
but it works well
« Last Edit: January 24, 2017, 07:19:49 PM by jedione »
help a friend....

qqplayer

  • Sr. Member
  • ****
  • Posts: 245
    • View Profile
Re: Adding loading video
« Reply #10 on: January 25, 2017, 01:29:41 PM »
is this what you want

http://forum.attractmode.org/index.php?topic=1081.0

would show a demo but "bandicam" records is all F-up....dont't know why
but it works well

Couldnt try this today , but I think thath is not what Im trying to do.
In this case uses png and I want to add a mp4 video loading animation.
My problem is stopp autoplaying the video on the background.
What I need is a function to start playing and fade in a video only when I launch a game and also fades out the video before I return to AM.

jedione

  • Hero Member
  • *****
  • Posts: 525
  • punktoe
    • View Profile
Re: Adding loading video
« Reply #11 on: January 25, 2017, 06:39:03 PM »
it works with .mp4 just tested
just need to modify the time....
let me know..tanx
help a friend....

qqplayer

  • Sr. Member
  • ****
  • Posts: 245
    • View Profile
Re: Adding loading video
« Reply #12 on: January 26, 2017, 06:52:27 AM »
it works with .mp4 just tested
just need to modify the time....
let me know..tanx

Well is working , but has the same problem , try to test with a 20 second video for example.
And open and close various games ?one after another.
It shows the video but randomly , not from the begining (second 0).
Sometimes second 3 , sometimes second 14 ...

Still needing help with this stuff.

keilmillerjr

  • Hero Member
  • *****
  • Posts: 583
    • View Profile
Re: Adding loading video
« Reply #13 on: January 26, 2017, 09:07:05 AM »
I could make a plugin to do this if. However, it would be useless unless attractmode actually launches the rom in the background and waits until the transition to game is completed. Does it do this?

qqplayer

  • Sr. Member
  • ****
  • Posts: 245
    • View Profile
Re: Adding loading video
« Reply #14 on: January 26, 2017, 12:37:45 PM »
I could make a plugin to do this if. However, it would be useless unless attractmode actually launches the rom in the background and waits until the transition to game is completed. Does it do this?

I think that is exactly how it works because I did something similar with a png sequence and seems to be waiting in the background.
Could be awesome a plugin to add transitions to game and from game.