Automatically playing a video file

So I am new at scripting and I am trying to use it for an art project. I am not sure if this is possible but I would like to write a script that automatically plays a video file located on a flash drive every time that flash drive is plugged in. Any helpful idea would be much appreciated!