random() API will give your deterministic pseudorandom values. Unlike the
Math.random() function, Remotions function takes in a seed which can be a
number or a
string. If the seed is the same, the output is always the same.
Randomness can be used to create to create interesting visualizations, such as particle effect for example. Since Remotion renders a video on multiple threads and opens the website multiple times, the value returned by a
Math.random() call will not be the same across multiple threads, making it hard to create animations based on randomness. Using this API will ensure that the pseudorandom number will be the same always.
Math.random() results in an ESLint warning in Remotion since often it leads to bugs in rendering. If you are sure you want a true random number, and want to bypass this message without adding an ignore comment, use