LOL thats not controlling a GIF.
That is just a bit of script.
They grab a frame ( first frame of image and store as say png ) with an overlay PLAY button.
Onclick they play gif is instantiated.
Nip on STACK and ask thm, its just js.
They have preview as:
and mask the GIF using a nifty bit of JS