Skip to content

Instantly share code, notes, and snippets.

@jujhars13
Created May 21, 2013 15:16
Show Gist options
  • Save jujhars13/5620609 to your computer and use it in GitHub Desktop.
Save jujhars13/5620609 to your computer and use it in GitHub Desktop.
internet explorer 9 fix for buto javascript embed #379 use this in place of old embed code
(function(d, conf) {
var b = d.createElement('script');
b.setAttribute('async', true);
b.src = '//embed.buto.tv/js/' + conf.object_id;
if (b.addEventListener) { //for IE<9
b.addEventListener("load", function() {
if (window.buto)
buto.addPlayer(conf);
}, false);
} else if (b.readyState) {
b.onreadystatechange = function() {
if (window.buto)
buto.addPlayer(conf);
};
}
var s = d.getElementsByTagName('script')[0];
s.parentNode.insertBefore(b, s);
})(document, {object_id: '<?= $this->video['video_id']; ?>', element_id: 'buto_<?= $this->video['video_id']; ?>', width: videoWidth, height: videoHeight});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment