I use i3lock as my lockscreen, I've coded a little script to obtain random background images on it, but now I want to have video as lockscreen so I want to know if there is a way to put a video in the i3lock's background and if it's possible how.
Unfortunately, i3lock does not support video playback.
From the i3lock documentation / manpage:
After starting it, you will see a white screen (you can configure the color/an image)
You can specify an image with -i path
and a color with -c rrggbb
. If you want to display video on your locked screen, see this question on the Unix/Linux site.