The close() method of the VideoDecoder interface ends all pending work and releases system resources.
close()
MDN Reference