There are mainly two methods to insert a video link in an image file:
Linking the HTML file containing the video with the image in a different HTML file.
- Create an html file and add the video.
<video src="video_url" controls></video>
Create another HTML file having the image, in which the image should contain the link of the previous HTML file.
<a href="html_file_url"> <img src="image_url"> </a>
Example: Below is the HTML file having the video.
Below is the main file having the image in which the image is linked with the above HTML file.
Create a single HTML file which contains both the image and the video. The video opens on clicking the image.
<video poster="image_url"> <source src="video_url" type="video_type"> </video>
Example: Below is the main html file.