Animated dashed line

I try to figure out if there is a way to recreate the same type flowing dashed line like in this video:

https://www.youtube.com/watch?v=kLGozi_7m1k