obsproject / obs-browser

CEF-based OBS Studio browser plugin
GNU General Public License v2.0
778 stars 221 forks source link

Missing JS Function: getVisibilityState #73

Closed SReject closed 4 years ago

SReject commented 7 years ago

Would be nice if there was a function similar to getCurrentScene that would return the visibility state.

// register the callback
window.obsstudio.getVisibilityState(function callback(state) {
    // Called after the BrowerSource's visibility state is retrieved
});
zavitax commented 5 years ago

What's wrong with document.hidden and the rest of the Document Visibility API? https://www.html5rocks.com/en/tutorials/pagevisibility/intro/

WizardCM commented 5 years ago

Just tested this myself - document.hidden definitely seems to do the job.