InteractiveAdvertisingBureau / openvv-html

OpenVV project to provide viewability data and API to HTML5 based video
Apache License 2.0
20 stars 13 forks source link

Add focus parameter to strategy or criteria #18

Open serbel opened 6 years ago

serbel commented 6 years ago

The OpenVV library considers Element as visible even if page has no focus. So when user minify browser or goes to another tab, MRC event will fire independently. It would be more correct viewablity measure if you add focus check and reset timers when page loses focus. Focus might be added as default for all events or as a tunable option in criteria, e.g.:

criteria = {
inViewThreshold: 0.5,
timeInView: 2000,
considerFocus: true
// "true" if Document must be in focus, or "false" if focus can be ignored
};