Plyr: If I set height on video element, fullscreen is broken

Created on 12 Feb 2017  路  3Comments  路  Source: sampotts/plyr

If there is a css height/width set on my

How can I force a size on the video, but still support fullscreen?

Example:

<video id='foo' class='afterglow' autoplay='true' controls style='max-height:140px;width:auto;' preload='auto' poster='' style='display: inline-block;'><source src='video/bar.webm' type='video/webm' /></video>

Most helpful comment

@MTyson
It's simply will done with pure CSS:

video {
  max-height: 140px;
}
.plyr:fullscreen video{
  max-height: initial;
}

P.S: for best browser compatibility use autoprefixer.

All 3 comments

You can try below.

$("button[data-plyr=fullscreen]").on("click", function() {                    
                setTimeout(function() {
                    $("video").css("height", "100%");
                }, 1000)
            });

I'm having same problem and It's not working.

@MTyson
It's simply will done with pure CSS:

video {
  max-height: 140px;
}
.plyr:fullscreen video{
  max-height: initial;
}

P.S: for best browser compatibility use autoprefixer.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

osamay picture osamay  路  4Comments

Generalomosco picture Generalomosco  路  3Comments

nam-co picture nam-co  路  4Comments

onigetoc picture onigetoc  路  3Comments

ahmadshc picture ahmadshc  路  4Comments