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

BUG: OpenVV() relies on global 'element' variable #10

Closed vladgurgov closed 6 years ago

vladgurgov commented 7 years ago

if you rename 'element' to 'el' in demo.js `var openvv = new OpenVV(), el = document.getElementById('elementToMeasure');

var executor = openvv .measureElement(el) ...`

you will get exception: MeasurementExecutor.js:164 Uncaught ReferenceError: element is not defined at MeasurementExecutor._instantiateTechnique (MeasurementExecutor.js:164) at Array.map (<anonymous>) at MeasurementExecutor._selectTechnique (MeasurementExecutor.js:153) at new MeasurementExecutor (MeasurementExecutor.js:34) at OpenVV.measureElement (OpenVV.js:28) at demo.js:22

I have a patch PR for it, will add it a bit later...

vladgurgov commented 7 years ago

fix PR https://github.com/InteractiveAdvertisingBureau/openvv-html/pull/11

vladgurgov commented 7 years ago

@jdreetz there is a bug (typo) in MeasurementExecutor - using global var element instead of this._element

see PR for a fix.

jdreetz commented 7 years ago

Good catch! I misunderstood your original comment.