Skip to content

OVV in IFRAME capabilities

dbb613 edited this page Jun 26, 2014 · 1 revision

Question: What is the expected behavior and capabilities of OVV when used within an IFRAME?

I tried to get this working in an in-iframe use case and am wondering what to expect in terms of functionality. Perhaps I am doing something wrong, but what I see seems to be less than full functionality in terms of detecting viewability properties.

I setup tests that anyone who is curious can look at (my code is here https://github.com/dbb613/openvv/tree/test-pages_and_build-improvement)

I ran the iframe-parent.html test page through my browser (Chrome Version 35.0.1916.153 m) via a local web server, e.g. http://localhost/openvv/test-pages/iframe-parent.html. I have a demo.swf embedded in a page and then that page is loaded into an iframe in iframe-parent.html. In my demo.swf (Main.as), I have a timer that fires once per second and calls checkViewability() then dumps the result. See https://github.com/dbb613/openvv/blob/test-pages_and_build-improvement/src/Main.as#L33

What I find is that it always returns:

  • viewabilityState=viewable
  • focus=false
  • percentViewable=-1
  • clientWidth=-1
  • clientHeight=-1

If I re-size the browser window so that less than 50% of the flash asset in the child iframe is visible, the result continues to return viewabilityState=viewable.

Focus is always false unless I click within the child iframe area, but if focus is false, and I click directly on the flash asset, focus remains false.

The only time I see viewabilityState change to unviewable, is when I re-size the browser window such that the viewport is completely invisible and only the browser chrome shows (e.g. as if the top-level window height is 0).

It is completely unsurprising to me that the capabilities would be more limited when running within an IFRAME, but it would be nice to know what the expected capabilities of the new OpenVV release are expected to be in this use case. Also, given that browser support is an issue (e.g. it returns "unmeasurable" for viewabilityState in IE and maybe some versions of FF), it would be helpful to specify this too. Although in the code commits you mention it returning unmeasurable in IE and FF, I found that it worked in FF (I am using 27.01 on Windows 8).

I hope others find this helpful.

Thanks for a really nice update to OpenVV, the new implementation is really nice. I just wish it were able to do more that it appears to in the IFRAME use case.

Clone this wiki locally