Better option for creating animation? CSS/JavaScript or animated video?

I want to create a complex animation for my website, which one is a better option?

  1. Using CSS/JavaScript to program the animation using keyframes and JavaScript libraries
  2. Or creating an animated video and embedding the video on the website

I think

For CSS/JavaScript programming :

Disadvantage: it consumes a lot of processing power for rendering the animation on the client side

Advantage: is it is highly customizable

I would love to hear your take on this question.