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

[html] 第462天 HTML5如何监听video的全屏和退出全屏? #2671

Open
haizhilin2013 opened this issue Jul 20, 2020 · 2 comments
Open
Labels
html html

Comments

@haizhilin2013
Copy link
Collaborator

第462天 HTML5如何监听video的全屏和退出全屏?

3+1官网

我也要出题

@haizhilin2013 haizhilin2013 added the html html label Jul 20, 2020
@zhaofeipeter
Copy link

zhaofeipeter commented Jul 21, 2020

监听window.resize事件,判断document.fullscreenEnabled || document.fullScreen

@luna2216
Copy link

监听fullscreenchange事件

document.addEventListener('fullscreenchange', (event) => {
  // document.fullscreenElement will point to the element that
  // is in fullscreen mode if there is one. If there isn't one,
  // the value of the property is null.
  if (document.fullscreenElement) {
    console.log(`Element: ${document.fullscreenElement.id} entered full-screen mode.`);
  } else {
    console.log('Leaving full-screen mode.');
  }
});

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

No branches or pull requests

3 participants