/*!
Overlay plugin for Flowplayer HTML5
Copyright (c) 2016, Flowplayer Oy
Released under the MIT License: https://opensource.org/licenses/MIT
*/
!function(){var o=function(o){var e=o.common,n=o.bean;o(function(n,a){if(n.conf.overlay){n.conf.splash=n.conf.autoplay=!0,e.addClass(a,"is-overlaid"),e.addClass(a,"is-closeable");var l=n.conf.overlay.vendor||"native";if(!o.overlay[l])throw new Error('Overlay "'+l+'" not implemented');o.overlay[l](n,a)}}),o.overlay={},o.overlay.native=function(o,a){function l(){document.body.appendChild(t),e.addClass(a,"is-open")}function r(){t.parentNode&&document.body.removeChild(t),e.removeClass(a,"is-open")}var d=o.conf.overlay.trigger||o.conf.overlay,t=document.createElement("div");t.className="flowplayer-overlay-mask",t.appendChild(a);var c=function(e){e.preventDefault(),l(),o.load()};d.tagName?n.on(d,"click",c):n.on(document,"click",d,c),o.conf.keyboard&&n.on(document,"keydown",function(e){27===e.keyCode&&o.unload()}),o.on("unload",function(){r()})}};"object"==typeof module&&module.exports?module.exports=o:"function"==typeof flowplayer&&o(window.flowplayer)}();