Change image and video to media on input