My homepage features a captivating hero video in the background, but I've encountered an issue where the AMP video does not scale properly to fit the screen on mobile devices.
Here's the code snippet causing the problem:
<amp-video
autoplay
loop
width="640"
height="360"
class="hero"
layout="fill"
poster="{{URL::asset('p1.webp')}}"
>
<source src="{{URL::asset('dubai.webm')}}"
type="video/webm" />
<source src="{{URL::asset('dubai.mp4')}}"
type="video/mp4" />
<source src="{{URL::asset('v1.ogg')}}"
type="video/ogg" />
{{-- <div fallback>
<amp-img src="{{URL::asset('p1.webp')}}" width="640" height="360" alt="Dubai from above"></amp-img>
</div> --}}
</amp-video>
<!--blue filter over the video-->
<div class="v-text" style="z-index:2;position:absolute;background:rgba(2, 122, 195, 0.3)
;top:0;bottom:0;left:0;right:0;">
....
The strange thing is that a similar setup on another site works perfectly fine.