how to not call visibility if i made fullscreen
So in my app, I have games and when I click play , what I do is call fullscreen code which starts the game in fullscreen mode.
Somewhere in my app, I have this piece of code:
this.visibility = Visibility.change((event, state) => {
switch (state) {
case 'visible':
break;
case 'hidden':
console.log("coming here ? ");
break;
}
});
Now, this works fine for all cases except fullscreen. The thing I want is when fullscreen gets activated, I don't want it to call console.log("coming here ?"). I don't want it to do anything. Is this possible?
You do not need Visibility.js nowadays. Use standard API without extra library wrapper.
- So, what you're saying is i don't have to use this library at all to do what I want?
- Which one is the standard API? any link?
https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API
do you do anything in this wrapper so that it helps to work it out for more browser versions that it's currently supported on that link you linked?
Most modern browsers support Page Visibility API out of the box https://caniuse.com/#feat=mdn-api_document_onvisibilitychange