Skip to content

Applying Cross Fade #4273

Answered by gAlleb
WittyWidget asked this question in Q&A
Dec 17, 2024 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Crossfade always messes out with duration because it creates a new source all the way. You can try using radio source before crossfade to calculate progress bar. It may be not very precise but ok. Add radio_before_crossfade, modify def position() and put crossfade function after:

radio_before_crossfade = radio

def position() =
  source.elapsed(radio_before_crossfade) / source.duration(radio_before_crossfade)
end

radio = crossfade(fade_out=3., fade_in=3., duration=5., radio)

Also you have this code doubled in your config:

background =
  video.add_rectangle(
    color=0xfcb900,
    x=0 @ px,
    y=5350 @ px,
    height=50 @ px,
    width={position() @ vw},
    background
  )

radio = sou…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@WittyWidget
Comment options

@gAlleb
Comment options

Answer selected by WittyWidget
@WittyWidget
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants