openvv icon indicating copy to clipboard operation
openvv copied to clipboard

Invalid result of viewability

Open crayoned opened this issue 8 years ago • 0 comments

I have inserted swf-player on the page as <OBJECT data="..."><EMBED src="..." /></OBJECT> and in some browsers(Opera, Safari, Chrome) I get invalid result of viewability, because some browsers ignoring tag <EMBED> and it has not size value. Your JS script uses <EMBED> as default if it exists.

I found a temporary workaround. In function "findPlayer" check for "clientWidth" and if it doesn't exists then return "embeds[i].parentNode". But I do not think that it is the perfect solution.

Please fix it, if it possible.

P.S. sample of my changes

for (var i = 0; i < embeds.length; i++) {
    if (embeds[i][id] || embeds[i]['onJsReady' + id]) {
        if (embeds[i].clientWidth)  {
            return embeds[i];
        }
        else if(embeds[i].parentNode.nodeName.toUpperCase() === "OBJECT") {
            return embeds[i].parentNode;
        }
        else {
            // I have't any ideas
        }
    }
}

crayoned avatar Jul 29 '16 09:07 crayoned