Skip to content

Commit

Permalink
Fix fullscreen check logic
Browse files Browse the repository at this point in the history
Because of wrong check logic, if one player goes fullscreen, the op-fullscreen class is also attached to other players
  • Loading branch information
SangwonOh committed Feb 14, 2022
1 parent 48df21c commit 719565b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/ovenplayer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ovenplayer.js.map

Large diffs are not rendered by default.

15 changes: 14 additions & 1 deletion src/js/view/components/controls/fullScreenButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,20 @@ const FullScreenButton = function($container, api){
api.toggleFullScreen = toggleFullScreen;

function checkFullScreen(){
return document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement;

let fullScreen = false;

const fullScreenElement = document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement;

if (fullScreenElement) {

if ($root.get() === fullScreenElement) {
fullScreen = true;
}
}

return fullScreen;

};

function resetFullscreenButtonState(){
Expand Down

0 comments on commit 719565b

Please sign in to comment.