Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If you press ESC to exit full screen, the full screen button cannot be used #80

Open
zgangjin opened this issue Jun 2, 2017 · 1 comment

Comments

@zgangjin
Copy link

zgangjin commented Jun 2, 2017

If you press ESC to exit full screen, the full screen button cannot be used

@ondrejpaluch
Copy link

ondrejpaluch commented Oct 28, 2017

I had the same problem. I fixed it like this:

var wjs = require("wcjs-player");

var player = new wjs("#player").addPlayer({
  autoplay: true,
  wcjs: require('wcjs-prebuilt')
});

var onFullScreenChange = function ( event ) {
    var isFullScreen = ( 
        document.fullscreenElement != null || document.webkitFullscreenElement != null
    );

    if ( !isFullScreen ) {
        player.find(".wcp-minimize").removeClass("wcp-minimize").addClass("wcp-maximize");
    }
}; 

document.addEventListener("fullscreenchange", onFullScreenChange);
document.addEventListener("webkitfullscreenchange", onFullScreenChange);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants