Although a similar question was asked 6 years ago without any answers, I am currently facing the same issue.
Problem: The <video>
tag in my Angular/Ionic application overlaps my image and two buttons in iOS Mobile Safari - no matter what I try!
It functions correctly in all other browsers I've tested except for iOS mobile safari.
html
:
<ion-row style="height: 87vh; background: black">
<ion-col style="height: 100%" size="12">
<div class="outside_home">
<video playsinline [muted]="true" loop id="video" height="100%" autoplay>
<source src="{{homeInfo().videoUrl}}" type="video/mp4">
<source src="{{homeInfo().videoUrl}}" type="video/webm">
<source src="{{homeInfo().videoUrl}}" type="video/mov">
</video>
<div class="inside">
<ion-grid>
<ion-row class="ion-text-center ion-justify-content-center">
<ion-col size-xs="12" size-sm="10" size-md="8" size-lg="7" size-xl="6">
<picture>
<source type="image/webp">
<img [ngSrc]="homeInfo().homePageTitle" priority="true" alt="" style="min-height: 80px; display: block"
width="" height="">
</picture>
</ion-col>
</ion-row>
<ion-row class="ion-text-center">
<ion-col size-sm="6" class="ion-text-sm-end" size-xs="12">
<div style="padding-right: 3%; padding-left: 3%">
<ion-button fill="outline" class="video_text" (click)="navigateToPage('connect')">
Connect
</ion-button>
</div>
</ion-col>
<ion-col size-sm="6" class="ion-text-sm-start" size-xs="12">
<div style="padding-left: 3%; padding-right: 3%">
<ion-button fill="outline" class="video_text" (click)="navigateToPage('directions')">
Join in Person
</ion-button>
</div>
</ion-col>
</ion-row>
</ion-grid>
</div>
</div>
</ion-col>
</ion-row>
The video file itself is .mov format.
Here's my CSS:
div.outside_home {
display: flex;
position: absolute;
width: 100%;
min-height: 87vh;
vertical-align: middle;
justify-content: center;
}
div.inside {
width: 100%; /* Can be in percentage also. */
height: auto;
position: relative;
display: flex;
align-items: center;
justify-content: center;
}
I have tried everything possible - including adding overflow: visible
, adjusting z-index
, but nothing seems to work.
https://i.stack.imgur.com/KNejA.png
The video behind the text is playing - the image shows when no person is on screen - displaying what it should normally look like.
In iOS mobile safari, however, the img
and buttons
do not appear at all - they briefly show for a moment then disappear. Strangely, you can still interact with the invisible buttons on the screen. It's puzzling. Any assistance would be greatly appreciated.
Thank you for any help provided!