Is there a way to control the image size within an <img>
tag placed inside an html5 video
element? Currently, it keeps defaulting back to 0 x 0 pixels.
The reason behind using this img
is to serve as a fallback for outdated browsers where the video tag might not function properly.
Below is my code snippet (please note that I intentionally removed "myVideo.mp4" to simulate the fallback):
<video id="welcome" height="1080" width="1920" preload="auto" loop autoplay>
<source type="video/mp4" src="@Url.Content("~/_video/myVideo.mp4")" />
<img src="@Url.Content("~/_video/posterframe.jpg")" height="1080" width="1920"/>
</video>
Upon debugging in chrome, the result shows "0x0 pixels (Natural: 1920 x 1080)"
Any suggestions on how to resolve this issue would be greatly appreciated. Thank you!