mmistakes / minimal-mistakes

:triangular_ruler: Jekyll theme for building a personal site, blog, project documentation, or portfolio.
https://mmistakes.github.io/minimal-mistakes/
MIT License
12.42k stars 25.58k forks source link

Video full screen with masthead and footer #933

Closed silverHugh closed 7 years ago

silverHugh commented 7 years ago

Environment informations


Expected behavior

Is it normal to see "masthead" and "page_footer" when fullscreen a video?

Steps to reproduce the behavior

We can simply try it in this page: Post: Video (YouTube)

ScreenShot in my computer in full screen mode: 2017-04-05 18 18 09

mmistakes commented 7 years ago

What's your browser? Looks fine to me in latest Chrome, FF, IE, and Safari.

video

silverHugh commented 7 years ago

Not like this. I mean play the video and double click to make the IFRAME FULL SCREEN. And then you will see what I say. I have tested it in Chrome and Safari on my mac and Chrome on Windows. They all show masthead and footer in full screen mode. But I realized that the header video is normal. Layout: Header Video

mmistakes commented 7 years ago

I see what you mean. I'll have to look into a fix, not sure if I can do anything about it though.

What's going on is the header and footer elements are absolutely positioned with CSS so they overlap on top of the YouTube embed. Seems like a bug with YouTube's CSS. They would need to be absolutely positioned on top of the page.

Maybe I can override that, maybe not.

silverHugh commented 7 years ago

I also find the video tag can cause the same problem. Maybe it's not just youtube's CSS problem.

mmistakes commented 7 years ago

Looks like the browser applies these styles to the <iframe> when in fullscreen mode.

iframe:-webkit-full-screen {
    position: fixed;
    min-width: 0px;
    max-width: none;
    min-height: 0px;
    max-height: none;
    width: 100%;
    height: 100%;
    left: 0px;
    top: 0px;
    margin: 0px !important;
    padding: 0px !important;
    border-width: 0px !important;
    border-style: initial !important;
    border-color: initial !important;
    border-image: initial !important;
}
user agent stylesheet
:-webkit-full-screen {
    background-color: white;
    z-index: 2147483647;
}

Which with such a high z-index it should be placed on top of the masthead and footer who have a z-index of 20. But for whatever reason it's not.

Turning off z-index on those two elements fixes it, but breaks the rest of the site.

silverHugh commented 7 years ago

I get confused too. >_<

mmistakes commented 7 years ago
:-webkit-full-screen-ancestor .masthead,
:-webkit-full-screen-ancestor .page__footer {
  position: static;
}

This should fix it for webkit browsers and Chrome.

silverHugh commented 7 years ago

Awesome! It works!

lanceolenik commented 6 years ago

Hi all,

I'm having this same issue and the :-webkit-full-screen-ancestor fix isn't working for me. See http://www.biblechapel.org/about/leadership-programs/. It's only happening in Safari (Mac) when the full screen icon in the Vimeo video is clicked.

Any ideas why and how to fix?

mmistakes commented 6 years ago

@lokowebdesign For starters that site isn't even using the Minimal Mistakes theme 😝 .

Your problem is the #header container is appearing on top of it due to z-index order. Add something really high to .fluid-width-video-wrapper like z-index: 9999 and it'll fix the issue.

Safari's web developer tools are your friend. Just start inspecting elements and it becomes pretty clear what's going on if you check the CSS properties of the problematic elements.