Skip to content

Commit

Permalink
fix: set auto-fullscreen to use full height
Browse files Browse the repository at this point in the history
fixes viki.com subtitle issue
fixes #309
  • Loading branch information
samuelmaddock committed Jul 1, 2020
1 parent a209659 commit 143a9c1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/metastream-remote-extension/src/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,11 @@

// Fit media within viewport
function renderFullscreen() {
// Set minimum height for video to scale up to. Otherwise the video may
// reduce to its minimum height when transformed.
document.documentElement.style.setProperty('min-height', '100vh', 'important')

// Always hide document scrollbar while in fullscreen.
document.body.style.setProperty('overflow', 'hidden', 'important')

const { innerWidth: viewportWidth, innerHeight: viewportHeight } = window
Expand Down Expand Up @@ -914,6 +919,7 @@
console.debug('Stopping autofullscreen')
isFullscreen = false
fullscreenElement = undefined
document.documentElement.minHeight = ''
if (origDocumentOverflow) {
document.body.style.overflow = origDocumentOverflow
origDocumentOverflow = undefined
Expand Down

0 comments on commit 143a9c1

Please sign in to comment.