Computed Z-Index Does Not Match Element Style - html

Currently working on an html5 video player. I am running into an issue where once the video element is fullscreen, my custom controls are not clickable due to the video's z-index being set to the max int value; the same as the controls z-index. the default browser media controls are already hidden.
<div id="video-container">
<video frameborder='0' id="page-video" playsinline>
<source src='{{source}}'>
</video>
<div class="container" id="player-controls">
<!-- controls go here -->
</div>
</div>
here's the css for the video container in fullscreen:
#video-container {
position: relative;
max-width: 512px;
margin: 0 auto;
}
here's the css for the video in fullscreen:
#page-video:-webkit-full-screen {
width: 100%;
height: 100%;
position: relative;
z-index: 1 !important;
}
Here is the css for the controls:
#player-controls {
position: absolute;
bottom: 0;
left: 0;
max-width: 100%;
height: auto;
margin: 0 auto;
background: rgba(255, 255, 255, 0.8);
visibility: hidden;
transition: all .2s linear;
padding: 0;
width: 100%;
z-index: 2147483647;
cursor: pointer;
}
in the Chrome dev tools, the computed z-index for the video element is changed from auto when its NOT in fullscreen to 2147483647 however clicking on the arrow to expand, it shows the z-index: 1 !important style from my style sheet. This style is not crossed out or anything. I don't really understand why this is happening. These are the only two places in my entire style sheet that use z-index. There are no negative z-indexes anywhere.

The video tag will ignore the z-index you set on it and use the UA styles of "auto" and 2147483647 unless you set position: absolute or position: fixed on it. See HTML5 video ignoring z-index

To hide the native controls, you need to disable them via the "controls" attribute.
<video controls="false">...</video>
In some browsers, there seems to be a bug so that the native controls are still visible in fullscreen mode. You can override the browsers stylesheet and hide them manually:
video::-webkit-media-controls {
display:none !important;
}
To show your custom controlls, simply set the z-index to the max int value.
#player-controls {
z-index: 2147483647;
}
All of this is described in this blog: https://css-tricks.com/custom-controls-in-html5-video-full-screen/

Related

How to hide html video controls for Safari Mobile

I am currently using a video as a background for my website, it works perfectly in my chrome browser, but when I use safari- it shows the video controls for the video in the background. Is there any way to hide these controls or maybe just a better way to have the video in the background?
here's my code for the background video
HTML
<video id = 'home-bg' src = {require('../assets/leojaden-video-bg-2.mp4')} muted loop autoPlay playsinline/>
CSS
*{
box-sizing: border-box;
margin: 0;
padding: 0;
}
#home-bg{
position: absolute;
filter: brightness(80%);
top: 0;
left: 0;
height: 100vh;
width: 100vw;
object-fit: cover;
z-index: -1;
}
video::-webkit-media-controls {
display: none;
}
I am using reactjs for this website, so a react friendly solution would be helpful! :)
You can hide the controls by not adding the controls attribute to the video element.
<video autoplay playsinline></video>

HTML video showing black screen but sound is playing on iOS 15

My website shows a video using video tag which worked perfectly until not long ago.
The video is working but when pressing on full screen, the video is playing but the screen is black while the sound is still playing. The issue occurs only on iPhones with iOS 15 (using Safari and Chrome also).
Things I've tried:
I've tried playing the video directly with a URL to the actual file(to check its not codec issue) and it worked properly.
My video tag has 'position: absolute;' on it and I tried removing it(even though it breaks my layout) and that didn't work either.
Tried pausing the video immediately and playing it after the video loads.
Tried applying a background: white; or any non-transparent color to the video tag.
Tried removing auto play.
Tried to disable 'GPU process: Media' on safari settings just to check if that affects anything
and it didnt.
This is the html:
<video data-test-id="long-video" #longVideo muted controls playsinline [class.d-none]="!isShortVideoHidden"
*ngIf="isPageLoaded" src="https://cdn1.someurl.com/videos/commercial_1.mp4"
type="video/mp4">
</video>
and the css(with the parent):
#media only screen and(min-width:992px) {
.fixed-video {
position: fixed;
z-index: 10000;
margin: auto;
width: 100vw;
height: 100vh;
left: 0;
top: 0;
bottom: 0;
right: 0;
background: rgba(0, 0, 0, 0.5);
transition: 0.4s;
video {
width: 80%;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;
}
}
}
Please tell me if you have struggled with this and know how to solve it.
Thank you :)

Hide Scrollbar IFRAME 100%

first of all, I have read all the related topics created and none has worked for me.
I have this iframe 100% of the width and height of the screen
<iframe src="https://site.test" frameborder="0" id="iframe" style="display: block; overflow: hidden; border: none; height: 100vh; width: 100vw;"></iframe>
I tried this and it doesn't work for me
iframe { overflow:hidden; }
But it does not work. Be careful, I need to hide them, not disable them, so
scrolling ="no"
It does not serve me.
you can edit your code. remove display:block in inline css.
#iframe{
scrollbar-width: none;
-ms-overflow-style: none;
}
If you have access to the iframe then use these line of codes inside the iframe page CSS:
/* Works for Chrome */
::-webkit-scrollbar{width:0}
And
/* For Firefox and Microsoft Edge or IE */
html{scrollbar-width:none;-ms-overflow-style:none;}
how to?
a {
position: fixed;
overflow-y: hidden;
top: 0;
left: 0;
}

Links not clickable in IE

I'm working on this site http://zap3d.com/ and I have a problem: With Internet Explorer (IE) I can't click the two links (Upload and Download) but with Chrome and Firefox I can.
Here is my CSS for Upload button
.upload_button {
position: absolute;
left: 47px;
bottom: 28px;
width: 237px;
height: 41px;
border: none;
background: transparent;
}
Thanks
Some versions of Internet Explorer may not register clicks on elements that have a transparent background, and no content within. In these cases, set your element's opacity to zero:
.upload_button {
opacity: 0;
}
You'll get the same invisible element effect, while maintaining cross-browser compatibility.

ie9 scroll bar and etched border always showing on object

I've got some simple html and css (see below) that shows a flex app inside a Div tag. In most browsers (ie8, chrome, FF), the object doesn't have a border or a vertical scrollbar. In ie9, both a scrollbar and a 3D etched border are shown. I'd like to remove those, I tried various border styles but nothing seem to help. Does anyone have a solution for this? Is this a known problem for ie9 only?
I'm kind of new to Html, CSS, javascript, etc. and I have to say, IE browsers are a pain!
#mapLocation
{
position: absolute;
top: 131px;
left:0;
z-index: 0;
bottom: 120px;
width: 100%;
z-index: 2;
border-style: none;
}
#mapObject{
position:relative;
width: 100%;
height: 100%;
z-index: 2;
border-style: none;
}
</style>
<div id="mapLocation" >
<object id="mapObject" type="text/html" data="otherFile.html"></object>
</div>
Thanks for any help,
Ggilmann
I just had the same issue. It may be a compatibility mode that is switched on in your IE9 browser. Try to uncheck it.