It's not a problem to program something like this, but no one would want to because it will really slow down the page loading.
Mobile performance 23 / 100
Computer performance 50 / 100
Example of how to insert a video into the list of images in the product detail:
<li class="thumb-container js-thumb-container"> <div class="product-video-thumb" style="border: silver 3px solid;width: fit-content;display: inline-block;position: absolute;cursor:pointer;"> <video id="video-background" autoplay="true" muted="" style="max-height:88px;" loop autoplay preload="true"> <source src="/img/videos/test-video.mp4" type="video/mp4"> </video> </div> </li>