UNPKG

flowplayer

Version:
6 lines (4 loc) 168 kB
/*! Flowplayer v7.2.7 (2018-08-13) | flowplayer.com/license */ !function(e){function t(e,t,n,i){for(var r,o=n.slice(),a=(c=e,(u=t).currentTarget=c,u.eventPhase=u.target===u.currentTarget?2:3,u),s=0,l=o.length;s<l&&(handler=o[s],"object"==typeof handler&&"function"==typeof handler.handleEvent?handler.handleEvent(a):handler.call(e,a),!a.stoppedImmediatePropagation);s++);var u,c;return r=!a.stoppedPropagation,i&&r&&e.parentNode?e.parentNode.dispatchEvent(a):!a.defaultPrevented}function n(e,t){return{configurable:!0,get:e,set:t}}function i(e,t,i){var r=y(t||e,i);m(e,"textContent",n(function(){return r.get.call(this)},function(e){r.set.call(this,e)}))}function r(e,t){for(var n=e.length;n--&&e[n]!==t;);return n}function o(){if("BR"===this.tagName)return"\n";for(var e=this.firstChild,t=[];e;)8!==e.nodeType&&7!==e.nodeType&&t.push(e.textContent),e=e.nextSibling;return t.join("")}function a(e){!f&&C.test(document.readyState)&&(f=!f,document.detachEvent(d,a),(e=document.createEvent("Event")).initEvent(p,!0,!0),document.dispatchEvent(e))}function s(e){for(var t;t=this.lastChild;)this.removeChild(t);null!=e&&this.appendChild(document.createTextNode(e))}function l(t,n){return n||(n=e.event),n.target||(n.target=n.srcElement||n.fromElement||document),n.timeStamp||(n.timeStamp=(new Date).getTime()),n}if(!document.createEvent){var u,c=!0,f=!1,d="onreadystatechange",p="DOMContentLoaded",h="__IE8__"+Math.random(),g=e.Object,m=g.defineProperty||function(e,t,n){e[t]=n.value},v=g.defineProperties||function(t,n){for(var i in n)if(w.call(n,i))try{m(t,i,n[i])}catch(n){e.console&&console.log(i+" failed on object:",t,n.message)}},y=g.getOwnPropertyDescriptor,w=g.prototype.hasOwnProperty,b=e.Element.prototype,I=e.Text.prototype,M=/^[a-z]+$/,C=/loaded|complete/,A={},S=document.createElement("div");i(e.HTMLCommentElement.prototype,b,"nodeValue"),i(e.HTMLScriptElement.prototype,null,"text"),i(I,null,"nodeValue"),i(e.HTMLTitleElement.prototype,null,"text"),m(e.HTMLStyleElement.prototype,"textContent",(u=y(e.CSSStyleSheet.prototype,"cssText"),n(function(){return u.get.call(this.styleSheet)},function(e){u.set.call(this.styleSheet,e)}))),v(b,{textContent:{get:o,set:s},firstElementChild:{get:function(){for(var e=this.childNodes||[],t=0,n=e.length;t<n;t++)if(1==e[t].nodeType)return e[t]}},lastElementChild:{get:function(){for(var e=this.childNodes||[],t=e.length;t--;)if(1==e[t].nodeType)return e[t]}},previousElementSibling:{get:function(){for(var e=this.previousSibling;e&&1!=e.nodeType;)e=e.previousSibling;return e}},nextElementSibling:{get:function(){for(var e=this.nextSibling;e&&1!=e.nodeType;)e=e.nextSibling;return e}},childElementCount:{get:function(){for(var e=0,t=this.childNodes||[],n=t.length;n--;e+=1==t[n].nodeType);return e}},addEventListener:{value:function(e,n,i){var o,a=this,s="on"+e,u=a[h]||m(a,h,{value:{}})[h],c=u[s]||(u[s]={}),f=c.h||(c.h=[]);if(!w.call(c,"w")){if(c.w=function(e){return e[h]||t(a,l(0,e),f,!1)},!w.call(A,s))if(M.test(e))try{(o=document.createEventObject())[h]=!0,9!=a.nodeType&&null==a.parentNode&&S.appendChild(a),a.fireEvent(s,o),A[s]=!0}catch(o){for(A[s]=!1;S.hasChildNodes();)S.removeChild(S.firstChild)}else A[s]=!1;(c.n=A[s])&&a.attachEvent(s,c.w)}r(f,n)<0&&f[i?"unshift":"push"](n)}},dispatchEvent:{value:function(e){var n,i=this,r="on"+e.type,o=i[h],a=o&&o[r],s=!!a;return e.target||(e.target=i),s?a.n?i.fireEvent(r,e):t(i,e,a.h,!0):!(n=i.parentNode)||n.dispatchEvent(e),!e.defaultPrevented}},removeEventListener:{value:function(e,t,n){var i="on"+e,o=this[h],a=o&&o[i],s=a&&a.h,l=s?r(s,t):-1;-1<l&&s.splice(l,1)}}}),v(I,{addEventListener:{value:b.addEventListener},dispatchEvent:{value:b.dispatchEvent},removeEventListener:{value:b.removeEventListener}}),v(e.XMLHttpRequest.prototype,{addEventListener:{value:function(e,t,n){var i=this,o="on"+e,a=i[h]||m(i,h,{value:{}})[h],s=a[o]||(a[o]={}),l=s.h||(s.h=[]);r(l,t)<0&&(i[o]||(i[o]=function(){var t=document.createEvent("Event");t.initEvent(e,!0,!0),i.dispatchEvent(t)}),l[n?"unshift":"push"](t))}},dispatchEvent:{value:function(e){var n="on"+e.type,i=this[h],r=i&&i[n];return!!r&&(r.n?this.fireEvent(n,e):t(this,e,r.h,!0))}},removeEventListener:{value:b.removeEventListener}}),v(e.Event.prototype,{bubbles:{value:!0,writable:!0},cancelable:{value:!0,writable:!0},preventDefault:{value:function(){this.cancelable&&(this.defaultPrevented=!0,this.returnValue=!1)}},stopPropagation:{value:function(){this.stoppedPropagation=!0,this.cancelBubble=!0}},stopImmediatePropagation:{value:function(){this.stoppedImmediatePropagation=!0,this.stopPropagation()}},initEvent:{value:function(e,t,n){this.type=e,this.bubbles=!!t,this.cancelable=!!n,this.bubbles||this.stopPropagation()}}}),v(e.HTMLDocument.prototype,{textContent:{get:function(){return 11===this.nodeType?o.call(this):null},set:function(e){11===this.nodeType&&s.call(this,e)}},addEventListener:{value:function(t,n,i){var r=this;b.addEventListener.call(r,t,n,i),c&&t===p&&!C.test(r.readyState)&&(c=!1,r.attachEvent(d,a),e==top&&function e(t){try{r.documentElement.doScroll("left"),a()}catch(t){setTimeout(e,50)}}())}},dispatchEvent:{value:b.dispatchEvent},removeEventListener:{value:b.removeEventListener},createEvent:{value:function(e){var t;if("Event"!==e)throw new Error("unsupported "+e);return(t=document.createEventObject()).timeStamp=(new Date).getTime(),t}}}),v(e.Window.prototype,{getComputedStyle:{value:function(){function e(e){this._=e}function t(){}var n=/^(?:[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|))(?!px)[a-z%]+$/,i=/^(top|right|bottom|left)$/,r=/\-([a-z])/g,o=function(e,t){return t.toUpperCase()};return e.prototype.getPropertyValue=function(e){var t,a,s,l=this._,u=l.style,c=l.currentStyle,f=l.runtimeStyle;return e=("float"===e?"style-float":e).replace(r,o),t=c?c[e]:u[e],n.test(t)&&!i.test(e)&&(a=u.left,(s=f&&f.left)&&(f.left=c.left),u.left="fontSize"===e?"1em":t,t=u.pixelLeft+"px",u.left=a,s&&(f.left=s)),null==t?t:t+""||"auto"},t.prototype.getPropertyValue=function(){return null},function(n,i){return i?new t(n):new e(n)}}()},addEventListener:{value:function(n,i,o){var a,s=e,u="on"+n;s[u]||(s[u]=function(e){return t(s,l(0,e),a,!1)}),r(a=s[u][h]||(s[u][h]=[]),i)<0&&a[o?"unshift":"push"](i)}},dispatchEvent:{value:function(t){var n=e["on"+t.type];return!n||!1!==n.call(e,t)&&!t.defaultPrevented}},removeEventListener:{value:function(t,n,i){var o=(e["on"+t]||g)[h],a=o?r(o,n):-1;-1<a&&o.splice(a,1)}}})}}(this),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).flowplayer=e()}}(function(){return function e(t,n,i){function r(a,s){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return r(n||e)},c,c.exports,e,t,n,i)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<i.length;a++)r(i[a]);return r}({1:[function(e,t,n){"use strict";var i=t.exports={},r=e("class-list"),o=window.jQuery,a=e("punycode"),s=e("computed-style");i.noop=function(){},i.identity=function(e){return e},i.removeNode=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},i.find=function(e,t){return o?o(e,t).toArray():(t=t||document,Array.prototype.map.call(t.querySelectorAll(e),function(e){return e}))},i.text=function(e,t){e["innerText"in e?"innerText":"textContent"]=t},i.findDirect=function(e,t){return i.find(e,t).filter(function(e){return e.parentNode===t})},i.hasClass=function(e,t){return"string"==typeof e.className&&r(e).contains(t)},i.isSameDomain=function(e){var t=window.location,n=i.createElement("a",{href:e});return t.hostname===n.hostname&&t.protocol===n.protocol&&t.port===n.port},i.css=function(e,t,n){return"object"==typeof t?Object.keys(t).forEach(function(n){i.css(e,n,t[n])}):void 0!==n?""===n?e?e.style.removeProperty(t):void 0:e?e.style.setProperty(t,n):void 0:e?s(e,t):void 0},i.createElement=function(e,t,n){try{var r=document.createElement(e);for(var a in t)t.hasOwnProperty(a)&&("css"===a?i.css(r,t[a]):i.attr(r,a,t[a]));return n&&(r.innerHTML=n),r}catch(i){if(!o)throw i;return o("<"+e+">"+n+"</"+e+">").attr(t)[0]}},i.toggleClass=function(e,t,n){if(e){var i=r(e);void 0===n?i.toggle(t):n?i.add(t):n||i.remove(t)}},i.addClass=function(e,t){return i.toggleClass(e,t,!0)},i.removeClass=function(e,t){return i.toggleClass(e,t,!1)},i.append=function(e,t){return e.appendChild(t),e},i.appendTo=function(e,t){return i.append(t,e),e},i.prepend=function(e,t){e.insertBefore(t,e.firstChild)},i.insertAfter=function(e,t,n){t==i.lastChild(e)&&e.appendChild(n);var r=Array.prototype.indexOf.call(e.children,t);e.insertBefore(n,e.children[r+1])},i.html=function(e,t){(e=e.length?e:[e]).forEach(function(e){e.innerHTML=t})},i.attr=function(e,t,n){if("class"===t&&(t="className"),i.hasOwnOrPrototypeProperty(e,t))try{e[t]=n}catch(i){if(!o)throw i;o(e).attr(t,n)}else!1===n?e.removeAttribute(t):e.setAttribute(t,n);return e},i.prop=function(e,t,n){if(void 0===n)return e&&e[t];e[t]=n},i.offset=function(e){var t=e.getBoundingClientRect();return e.offsetWidth/e.offsetHeight>e.clientWidth/e.clientHeight&&(t={left:100*t.left,right:100*t.right,top:100*t.top,bottom:100*t.bottom,width:100*t.width,height:100*t.height}),t},i.width=function(e,t){if(t)return e.style.width=(""+t).replace(/px$/,"")+"px";var n=i.offset(e).width;return void 0===n?e.offsetWidth:n},i.height=function(e,t){if(t)return e.style.height=(""+t).replace(/px$/,"")+"px";var n=i.offset(e).height;return void 0===n?e.offsetHeight:n},i.lastChild=function(e){return e.children[e.children.length-1]},i.hasParent=function(e,t){for(var n=e.parentElement;n;){if("string"!=typeof t){if(n===t)return!0}else if(i.matches(n,t))return!0;n=n.parentElement}return!1},i.createAbsoluteUrl=function(e){return i.createElement("a",{href:e}).href},i.xhrGet=function(e,t,n){var i=new XMLHttpRequest;i.onreadystatechange=function(){if(4===this.readyState)return this.status>=400?n():void t(this.responseText)},i.open("get",e,!0),i.send()},i.pick=function(e,t){var n={};return t.forEach(function(t){e.hasOwnProperty(t)&&(n[t]=e[t])}),n},i.hostname=function(e){return a.toUnicode(e||window.location.hostname)},i.browser={webkit:"WebkitAppearance"in document.documentElement.style},i.getPrototype=function(e){return Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__},i.hasOwnOrPrototypeProperty=function(e,t){for(var n=e;n;){if(Object.prototype.hasOwnProperty.call(n,t))return!0;n=i.getPrototype(n)}return!1},i.matches=function(e,t){var n=Element.prototype;return(n.matches||n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),n=0;t[n]&&t[n]!==this;)n++;return!!t[n]}).call(e,t)},function(e){function t(e){return e.replace(/-[a-z]/g,function(e){return e[1].toUpperCase()})}void 0!==e.setAttribute&&(e.setProperty=function(e,n){return this.setAttribute(t(e),String(n))},e.getPropertyValue=function(e){return this.getAttribute(t(e))||null},e.removeProperty=function(e){var n=this.getPropertyValue(e);return this.removeAttribute(t(e)),n})}(window.CSSStyleDeclaration.prototype)},{"class-list":36,"computed-style":37,punycode:44}],2:[function(e,t,n){"use strict";var i=e("../common");t.exports=function(e,t,n,r){n=n||"opaque";var o="obj"+(""+Math.random()).slice(2,15),a='<object class="fp-engine" id="'+o+'" name="'+o+'" ',s=navigator.userAgent.indexOf("MSIE")>-1;a+=s?'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">':' data="'+e+'" type="application/x-shockwave-flash">';var l={width:"100%",height:"100%",allowscriptaccess:"always",wmode:n,quality:"high",flashvars:"",movie:e+(s?"?"+o:""),name:o};"transparent"!==n&&(l.bgcolor=r||"#333333"),Object.keys(t).forEach(function(e){l.flashvars+=e+"="+t[e]+"&"}),Object.keys(l).forEach(function(e){a+='<param name="'+e+'" value="'+l[e]+'"/>'}),a+="</object>";var u=i.createElement("div",{},a);return i.find("object",u)},window.attachEvent&&window.attachEvent("onbeforeunload",function(){window.__flash_savedUnloadHandler=window.__flash_unloadHandler=function(){}})},{"../common":1}],3:[function(e,t,n){"use strict";var i,r=e("../flowplayer"),o=e("../common"),a=e("./embed"),s=e("extend-object"),l=e("bean");function u(e){return/^https?:/.test(e)}(i=function(e,t){var n,c,f,d,p=e.conf,h=[],g={engineName:i.engineName,pick:function(t){var n=s({},function(){if(r.support.flashVideo){for(var n,i,o=0;o<t.length;o++)if(i=t[o],/mp4|flv|flash/i.test(i.type)&&(n=i),e.conf.swfHls&&/mpegurl/i.test(i.type)&&(n=i),n&&!/mp4/i.test(n.type))return n;return n}}());if(n)return!n.src||u(n.src)||e.conf.rtmp||n.rtmp||(n.src=o.createAbsoluteUrl(n.src)),n},suspendEngine:function(){d=!0},resumeEngine:function(){d=!1},load:function(i){function v(e){return e.replace(/&amp;/g,"%26").replace(/&/g,"%26").replace(/=/g,"%3D")}n=i,h.forEach(function(e){clearTimeout(e)});var y=o.findDirect("video",t)[0]||o.find(".fp-player > video",t)[0],w=i.src,b=u(w),I=function(){o.removeNode(y)};r.support.video&&o.prop(y,"autoplay")&&i.sources.some(function(e){return!!y.canPlayType(e.type)})?l.one(y,"timeupdate",I):I();var M,C=i.rtmp||p.rtmp;if(b||C||(w=o.createAbsoluteUrl(w)),f&&m(i)&&f.data!==o.createAbsoluteUrl(p.swfHls)&&g.unload(),f){["live","preload","loop"].forEach(function(e){i.hasOwnProperty(e)&&f.__set(e,i[e])}),Object.keys(i.flashls||{}).forEach(function(e){f.__set("hls_"+e,i.flashls[e])});var A=!1;if(!b&&C)f.__set("rtmp",C.url||C);else A=!!f.__get("rtmp"),f.__set("rtmp",null);f.__play(w,A||i.rtmp&&i.rtmp!==p.rtmp)}else{c="fpCallback"+(""+Math.random()).slice(3,15),w=v(w);var S={hostname:p.embedded?o.hostname(p.hostname):o.hostname(location.hostname),url:w,callback:c};t.getAttribute("data-origin")&&(S.origin=t.getAttribute("data-origin")),["proxy","key","autoplay","preload","subscribe","live","loop","debug","splash","poster","rtmpt"].forEach(function(e){p.hasOwnProperty(e)&&(S[e]=p[e]),i.hasOwnProperty(e)&&(S[e]=i[e]),(p.rtmp||{}).hasOwnProperty(e)&&(S[e]=(p.rtmp||{})[e]),(i.rtmp||{}).hasOwnProperty(e)&&(S[e]=(i.rtmp||{})[e])}),p.splash&&(S.autoplay=!0),p.rtmp&&(S.rtmp=p.rtmp.url||p.rtmp),i.rtmp&&(S.rtmp=i.rtmp.url||i.rtmp),Object.keys(i.flashls||{}).forEach(function(e){var t=i.flashls[e];S["hls_"+e]=t});var E=void 0!==i.hlsQualities?i.hlsQualities:p.hlsQualities;void 0!==E&&(S.hlsQualities=E?encodeURIComponent(JSON.stringify(E)):E),void 0!==p.bufferTime&&(S.bufferTime=p.bufferTime),void 0!==p.bufferTimeMax&&(S.bufferTimeMax=p.bufferTimeMax),b&&delete S.rtmp,S.rtmp&&(S.rtmp=v(S.rtmp));var D,N=p.bgcolor||o.css(t,"background-color")||"";0===N.indexOf("rgb")?D=function(e){function t(e){return("0"+parseInt(e).toString(16)).slice(-2)}if(!(e=e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/)))return;return"#"+t(e[1])+t(e[2])+t(e[3])}(N):0===N.indexOf("#")&&(D=7===(M=N).length?M:"#"+M.split("").slice(1).map(function(e){return e+e}).join("")),S.initialVolume=e.volumeLevel;var j=m(i)?p.swfHls:p.swf;f=a(j,S,p.wmode,D)[0];var L=o.find(".fp-player",t)[0];o.prepend(L,f),e.off("quality.flashengine").on("quality.flashengine",function(t,n,i){if(void 0!==e.video.hlsQualities?e.video.hlsQualities:e.conf.hlsQualities)try{f.__quality(i)}catch(t){e.debug("Error changing quality in flash engine",t)}}),setTimeout(function(){try{if(!f.PercentLoaded())return e.trigger("error",[e,{code:7,url:p.swf}])}catch(e){}},5e3),h.push(setTimeout(function(){void 0===f.PercentLoaded&&e.trigger("flashdisabled",[e])},15e3)),h.push(setTimeout(function(){void 0===f.PercentLoaded&&e.trigger("flashdisabled",[e,!1])},500)),e.off("resume.flashhack").on("resume.flashhack",function(){var t=setTimeout(function(){var t=f.__status().time,n=setTimeout(function(){e.playing&&!e.loading&&f.__status().time===t&&e.trigger("flashdisabled",[e])},400);h.push(n),e.one("seek.flashhack pause.flashhack load.flashack",function(){clearTimeout(n)})},800);h.push(t),e.one("progress",function(){clearTimeout(t)})}),f.pollInterval=setInterval(function(){if(f&&!d){var t=f.__status?f.__status():null;t&&((e.conf.live||e.live||i.live)&&(i.seekOffset=t.seekOffset,i.duration=t.duration+t.seekOffset),e.playing&&t.time&&t.time!==e.video.time&&e.trigger("progress",[e,t.time]),i.buffer=t.buffer/i.bytes*i.duration,e.trigger("buffer",[e,i.buffer]),!i.buffered&&t.time>0&&(i.buffered=!0,e.trigger("buffered",[e])))}},250),window[c]=function(i,r){var o=n;p.debug&&(0===i.indexOf("debug")&&r&&r.length?console.log.apply(console,["-- "+i].concat(r)):console.log("--",i,r));var a={type:i};switch(i){case"ready":r=s(o,r);break;case"click":a.flash=!0;break;case"keydown":a.which=r;break;case"seek":o.time=r;break;case"status":e.trigger("progress",[e,r.time]),r.buffer<o.bytes&&!o.buffered?(o.buffer=r.buffer/o.bytes*o.duration,e.trigger("buffer",o.buffer)):o.buffered||(o.buffered=!0,e.trigger("buffered"));break;case"metadata":var u=atob(r);r={key:u.substr(10,4),data:u.substr(21)}}"click"===i||"keydown"===i?(a.target=t,l.fire(t,i,[a])):"buffered"!=i&&"unload"!==i?setTimeout(function(){e.trigger(a,[e,r])},1):"unload"===i&&e.trigger(a,[e,r])}}},speed:o.noop,unload:function(){f&&f.__unload&&f.__unload();try{c&&window[c]&&delete window[c]}catch(e){}o.find("object",t).forEach(o.removeNode),f=0,e.off(".flashengine"),e.off(".flashhack"),clearInterval(f.pollInterval),h.forEach(function(e){clearTimeout(e)})}};function m(e){return/application\/x-mpegurl/i.test(e.type)}return["pause","resume","seek","volume"].forEach(function(t){g[t]=function(n){try{e.ready&&(void 0===n?f["__"+t]():f["__"+t](n))}catch(n){if(void 0===f["__"+t])return e.trigger("flashdisabled",[e]);throw n}}}),g}).engineName="flash",i.canPlay=function(e,t){return r.support.flashVideo&&/video\/(mp4|flash|flv)/i.test(e)||r.support.flashVideo&&t.swfHls&&/mpegurl/i.test(e)},r.engines.push(i)},{"../common":1,"../flowplayer":31,"./embed":2,bean:34,"extend-object":39}],4:[function(e,t,n){"use strict";var i,r=e("../flowplayer"),o=r.support,a=r.common,s=r.bean,l=e("./html5-factory");function u(e){return void 0!==window.Hls&&(/mpegurl/.test(e)&&window.Hls.isSupported())}(i=function(e,t){var n,o,c=window.Hls;return l("hlsjs-lite",e,t,u,function(l,u,f){var d=r.extend({recoverMediaError:!0},e.conf.hlsjs,l.hlsjs);e.engine.hls&&e.engine.hls.destroy();var p,h,g=e.engine.hls=new c(d);i.extensions.forEach(function(n){n({hls:g,player:e,root:t,videoTag:u})}),g.loadSource(l.src),f.resume=function(){e.live&&!e.dvr&&(u.currentTime=g.liveSyncPosition||0),u.play()},f.seek=function(t){try{e.live||e.dvr?u.currentTime=Math.min(t,g.liveSyncPosition||u.duration-d.livePositionOffset):u.currentTime=t}catch(n){e.debug("Failed to seek to ",t,n)}},!1===d.bufferWhilePaused&&e.on("pause",function(){g.stopLoad(),e.one("resume",function(){g.startLoad()})}),e.on("quality",function(e,t,i){g.nextLevel=n=i});var m=function(n){if(e.debug("hlsjs - recovery"),a.removeClass(t,"is-paused"),a.addClass(t,"is-seeking"),s.one(u,"seeked",function(){u.paused&&(a.removeClass(t,"is-poster"),e.poster=!1,u.play()),a.removeClass(t,"is-seeking")}),n)return g.startLoad();var i=performance.now();!p||i-p>3e3?(p=performance.now(),g.recoverMediaError()):(!h||i-h>3e3)&&(h=performance.now(),g.swapAudioCodec(),g.recoverMediaError())};return g.on(c.Events.MANIFEST_PARSED,function(t,i){var r,s=l.hlsQualities||e.conf.hlsQualities,c={},f=i.levels;if(!1===s)return g.attachMedia(u);if("drive"===s)switch(f.length){case 4:r=[1,2,3];break;case 5:r=[1,2,3,4];break;case 6:r=[1,3,4,5];break;case 7:r=[1,3,5,6];break;case 8:r=[1,3,6,7];break;default:r=f.length<3||f[0].height&&f[2].height&&f[0].height===f[2].height?[]:[1,2]}if(l.qualities=[{value:-1,label:"Auto"}],Array.isArray(s)){var d=s.find(function(e){return-1===e||e.level&&-1===e.level});d?l.qualities[0].label="number"!=typeof d?d.label:l.qualities[0].label:l.qualities=[],r=s.map(function(e){return void 0!==e.level&&(c[e.level]=e.label),void 0!==e.level?e.level:e})}var p=-2;l.qualities=l.qualities.concat(f.map(function(e,t){if(r&&-1===r.indexOf(t))return!1;var i=c[t]||Math.min(e.width,e.height)+"p";return c[t]||"drive"===s||(i+=" ("+Math.round(e.bitrate/1e3)+"k)"),t===n&&(p=t),{value:t,label:i}})).filter(a.identity);var h=l.quality=-2===p?l.qualities[0].value||-1:p;h!==g.currentLevel&&(g.currentLevel=h),g.attachMedia(u),o&&l.src!==o&&u.play(),o=l.src}),g.on(c.Events.ERROR,function(t,n){if(n.fatal)if(d.recoverNetworkError&&n.type===c.ErrorTypes.NETWORK_ERROR)m(!0);else if(d.recoverMediaError&&n.type===c.ErrorTypes.MEDIA_ERROR)m(!1);else{var i=5;n.type===c.ErrorTypes.NETWORK_ERROR&&(i=2),n.type===c.ErrorTypes.MEDIA_ERROR&&(i=3),g.destroy(),e.trigger("error",[e,{code:i}])}}),e.one("unload",function(){g.destroy()}),{handlers:{error:function(e,t){var n=t.error&&t.error.code;return d.recoverMediaError&&3===n||!n?(e.preventDefault(),m(!1),!0):d.recoverNetworkError&&2===n?(e.preventDefault(),m(!0),!0):void 0}}}})}).canPlay=function(e,t){return!(!1===t.hlsjs||t.clip&&!1===t.clip.hlsjs)&&(!(o.browser.safari&&!(t.clip&&t.clip.hlsjs||t.hlsjs||{}).safari)&&(r.support.video&&u(e)))},i.engineName="hlsjs-lite",i.plugin=function(e){i.extensions.push(e)},i.extensions=[],r.engines.push(i)},{"../flowplayer":31,"./html5-factory":5}],5:[function(e,t,n){var i=e("../flowplayer"),r=i.common,o=i.support,a=i.bean,s=i.extend,l=o.browser.safari&&!o.iOS,u={ended:"finish",pause:"pause",play:"resume",timeupdate:"progress",volumechange:"volume",ratechange:"speed",seeked:"seek",loadedmetadata:l?0:"ready",canplaythrough:l?"ready":0,durationchange:"ready",error:"error",dataunavailable:"error",webkitendfullscreen:!i.support.inlineVideo&&"unload",progress:"buffer"};function c(e,t){return t=t||100,Math.round(e*t)/t}t.exports=function(e,t,n,i,l){var f,d,p,h=r.findDirect("video",n)[0]||r.find(".fp-player > video",n)[0],g=t.conf;return p={engineName:e,pick:function(e){var t=o.video&&e.filter(function(e){return i(e.type)})[0];if(t)return"string"==typeof t.src&&(t.src=r.createAbsoluteUrl(t.src)),t},load:function(e){var f=r.find(".fp-player",n)[0],m=!1;if(h||(h=document.createElement("video"),r.prepend(f,h),h.autoplay=!!g.splash,m=!0),r.addClass(h,"fp-engine"),r.find("track",h).forEach(r.removeNode),h.preload="none",g.nativesubtitles||r.attr(h,"crossorigin",!1),g.disableInline||(h.setAttribute("webkit-playsinline","true"),h.setAttribute("playsinline","true")),o.inlineVideo||r.css(h,{position:"absolute",top:"-9999em"}),o.subtitles&&g.nativesubtitles&&e.subtitles&&e.subtitles.length){r.addClass(h,"native-subtitles");var v=e.subtitles,y=function(e){var t=h.textTracks;t.length&&(t[0].mode=e)};v.some(function(e){return!r.isSameDomain(e.src)})&&r.attr(h,"crossorigin","anonymous"),"function"==typeof h.textTracks.addEventListener&&h.textTracks.addEventListener("addtrack",function(){y("disabled"),y("showing")}),v.forEach(function(e){h.appendChild(r.createElement("track",{kind:"subtitles",srclang:e.srclang||"en",label:e.label||"en",src:e.src,default:e.default}))})}a.off(h,"timeupdate",r.noop),a.on(h,"timeupdate",r.noop),r.prop(h,"loop",!1),t.off(".loophack"),(e.loop||g.loop)&&t.on("finish.loophack",function(){t.resume()}),void 0!==d&&(h.volume=d);var w=l(e,h,p);if(g.autoplay||g.splash||e.autoplay){t.debug("Autoplay / Splash setup, try to start video"),h.load();var b=function(){try{var e=h.play();if(e&&e.catch){var n=function(e){if("AbortError"===e.name&&20===e.code)return m?void 0:h.play().catch(n);if(!g.mutedAutoplay)throw new Error("Unable to autoplay");return t.debug("Play errored, trying muted",e),t.mute(!0,!0),h.play()};e.catch(n).catch(function(){g.autoplay=!1,t.mute(!1,!0),t.trigger("stop",[t])})}}catch(e){t.debug("play() error thrown",e)}};h.readyState>0?b():a.one(h,"canplay",b)}if(p._listeners=function(e,l,f,d){var p=n.getAttribute("data-flowplayer-instance-id");if(!e.listeners||!e.listeners.hasOwnProperty(p)){(e.listeners||(e.listeners={}))[p]=f,a.on(l,"error",function(n){try{i(n.target.getAttribute("type"))&&t.trigger("error",[t,{code:4,video:s(f,{src:e.src,url:e.src})}])}catch(e){}}),t.on("shutdown",function(){a.off(l),a.off(e,".dvrhack"),t.off(".loophack")});var h={},g=function(e){"metadata"===e.kind&&(e.mode="hidden",e.addEventListener("cuechange",function(){e.activeCues.length&&t.trigger("metadata",[t,e.activeCues[0].value])},!1))};return e&&e.textTracks&&e.textTracks.length&&Array.prototype.forEach.call(e.textTracks,g),e&&e.textTracks&&"function"==typeof e.textTracks.addEventListener&&e.textTracks.addEventListener("addtrack",function(e){g(e.track)},!1),(t.conf.dvr||t.dvr||f.dvr)&&a.on(e,"progress.dvrhack",function(){e.seekable.length&&(t.video.duration=e.seekable.end(null),t.video.seekOffset=e.seekable.start(null),t.trigger("dvrwindow",[t,{start:e.seekable.start(null),end:e.seekable.end(null)}]),e.currentTime>=e.seekable.start(null)||(e.currentTime=e.seekable.start(null)))}),Object.keys(u).forEach(function(i){var a=u[i];if("webkitendfullscreen"===i&&t.conf.disableInline&&(a="unload"),a){var l=function(l){if(f=e.listeners[p],l.target&&r.hasClass(l.target,"fp-engine")){/progress/.test(a)||t.debug(i,"->",a,l);var u,h=function(e){t.trigger(e||a,[t,u])};if((t.ready||/ready|error/.test(a))&&a&&r.find("video",n).length)if("unload"!==a){switch(a){case"ready":if(t.ready)return t.debug("Player already ready, not sending duplicate ready event");if(!(e.duration&&e.duration!==1/0||t.live))return t.debug("No duration and VOD setup, not sending ready event");if((u=s(f,{duration:e.duration<Number.MAX_VALUE?e.duration:0,width:e.videoWidth,height:e.videoHeight,url:e.currentSrc})).seekable=u.duration,t.debug("Ready: ",u),!t.live&&!u.duration&&!o.hlsDuration&&"loadeddata"===i){var g=function(){u.duration=e.duration;try{u.seekable=e.seekable&&e.seekable.end(null)}catch(e){}h(),e.removeEventListener("durationchange",g),r.toggleClass(n,"is-live",!1)};e.addEventListener("durationchange",g);var m=function(){t.ready||e.duration||(u.duration=0,r.addClass(n,"is-live"),h()),e.removeEventListener("timeupdate",m)};return void e.addEventListener("timeupdate",m)}break;case"progress":case"seek":if(e.currentTime>0||t.live)u=Math.max(e.currentTime,0);else if("seek"===a&&0===e.currentTime)u=0;else if("progress"==a)return;break;case"buffer":u=[];for(var v=0;v<e.buffered.length;v++)u.push({start:e.buffered.start(v),end:e.buffered.end(v)});e.buffered.length&&e.buffered.end(null)===e.duration&&h("buffered");break;case"speed":u=c(e.playbackRate);break;case"volume":u=c(e.muted?0:e.volume);break;case"error":try{if(d&&d.handlers&&d.handlers.error&&d.handlers.error(l,e))return;(u=(l.srcElement||l.originalTarget).error).video=s(f,{src:e.src,url:e.src})}catch(e){return}}h()}else t.unload();else"resume"===a&&t.one("ready",function(){setTimeout(function(){h()})})}};n.addEventListener(i,l,!0),h[i]||(h[i]=[]),h[i].push(l)}}),h}e.listeners[p]=f}(h,r.find("source",h).concat(h),e,w)||p._listeners,!(g.autoplay||g.splash||e.autoplay)){var I=function(){var e;(e=n.getBoundingClientRect()).top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)+e.height&&e.right<=(window.innerWidth||document.documentElement.clientWidth)+e.width&&(t.debug("player is in viewport, preload"),o.preloadMetadata?h.preload="metadata":h.load(),a.off(document,"scroll.preloadviewport"))};a.off(document,"scroll.preloadviewport"),a.on(document,"scroll.preloadviewport",function(){window.requestAnimationFrame(I)}),I()}},mute:function(e){h.muted=!!e,t.trigger("mute",[t,e]),t.trigger("volume",[t,e?0:h.volume])},pause:function(){h.pause()},resume:function(){h.play()},speed:function(e){h.playbackRate=e},seek:function(e){var n=h.paused||t.finished;try{h.currentTime=e,n&&a.one(h,"seeked",function(){h.pause()})}catch(e){}},volume:function(e){d=e,h&&(h.volume=e,e&&p.mute(!1))},unload:function(){a.off(document,"scroll.preloadviewport"),r.find("video.fp-engine",n).forEach(function(e){"MediaSource"in window?e.src=URL.createObjectURL(new MediaSource):e.src="",r.removeNode(e)}),f=clearInterval(f);var e=n.getAttribute("data-flowplayer-instance-id");delete h.listeners[e],h=0,p._listeners&&Object.keys(p._listeners).forEach(function(e){p._listeners[e].forEach(function(t){n.removeEventListener(e,t,!0)})})}}}},{"../flowplayer":31}],6:[function(e,t,n){"use strict";var i,r=e("../flowplayer"),o=r.common,a=e("./html5-factory"),s=document.createElement("video");function l(e){var t;return/^(video|application)/i.test(e)||(e=/mpegurl/i.test(t=e)?"application/x-mpegurl":t),!!s.canPlayType(e).replace("no","")}(i=function(e,t){return a("html5",e,t,l,function(e,t){t.currentSrc!==e.src?(o.find("source",t).forEach(o.removeNode),t.src=e.src,t.type=e.type):e.autoplay&&t.load()})}).canPlay=function(e){return r.support.video&&l(e)},i.engineName="html5",r.engines.push(i)},{"../flowplayer":31,"./html5-factory":5}],7:[function(e,t,n){"use strict";var i=e("../flowplayer"),r=e("../common"),o=e("bean");i(function(e,t){e.on("ready",function(){var e=r.find("video.fp-engine",t)[0];e&&(e.setAttribute("x-webkit-airplay","allow"),window.WebKitPlaybackTargetAvailabilityEvent&&(e.addEventListener("webkitplaybacktargetavailabilitychanged",function(e){if("available"===e.availability){var n=r.find(".fp-header",t)[0];r.find(".fp-airplay",n).forEach(r.removeNode);var i=r.createElement("a",{class:"fp-airplay fp-icon",title:"Play on AirPlay device"});n.insertBefore(i,r.find(".fp-fullscreen",n)[0])}}),e.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",function(){var n=r.find(".fp-airplay",t)[0];n&&r.toggleClass(n,"fp-active",e.webkitCurrentPlaybackTargetIsWireless)})))}),o.on(t,"click",".fp-airplay",function(e){e.preventDefault(),r.find("video.fp-engine",t)[0].webkitShowPlaybackTargetPicker()})})},{"../common":1,"../flowplayer":31,bean:34}],8:[function(e,t,n){"use strict";var i=e("../flowplayer"),r=e("./resolve").TYPE_RE,o=e("scriptjs"),a=e("bean");i(function(e,t){var n,i=e.conf.analytics,s=0,l=0;if(i){"undefined"==typeof _gat&&o("//google-analytics.com/ga.js");var u=function(){var e=_gat._getTracker(i);return e._setAllowLinker(!0),e},c=function(i,o,a){(a=a||e.video,s&&"undefined"!=typeof _gat)&&(u()._trackEvent("Video / Seconds played",e.engine.engineName+"/"+a.type,a.title||t.getAttribute("title")||a.src.split("/").slice(-1)[0].replace(r,""),Math.round(s/1e3)),s=0,n&&(clearTimeout(n),n=null))};e.bind("load unload",c).bind("progress",function(){e.seeking||(s+=l?+new Date-l:0,l=+new Date),n||(n=setTimeout(function(){n=null,u()._trackEvent("Flowplayer heartbeat","Heartbeat","",0,!0)},6e5))}).bind("pause",function(){l=0}),e.bind("shutdown",function(){a.off(window,"unload",c)}),a.on(window,"unload",c)}})},{"../flowplayer":31,"./resolve":21,bean:34,scriptjs:45}],9:[function(e,t,n){"use strict";var i=e("../flowplayer"),r=e("../common"),o=e("bean"),a=e("scriptjs");i(function(e,t){if(!1!==e.conf.chromecast){a("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"),window.__onGCastApiAvailable=function(e){var t,n,i;e&&(t=l.applicationId||chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,n=new chrome.cast.SessionRequest(t),i=new chrome.cast.ApiConfig(n,u,c),chrome.cast.initialize(i,f,d))};var n,i,s,l=e.conf.chromecast||{};o.on(t,"click",".fp-chromecast",function(o){if(o.preventDefault(),n)return e.trigger("pause",[e]),n.stop(),n=null,void p();e.playing&&e.pause(),chrome.cast.requestSession(function(o){var a=(n=o).receiver.friendlyName;r.html(r.find(".fp-chromecast-engine-status")[0],"Playing on device "+a);var l=new chrome.cast.media.MediaInfo(e.video.src),u=new chrome.cast.media.LoadRequest(l);n.loadMedia(u,function(o){o.addUpdateListener(function(a){if(n){i=i||setInterval(function(){e.trigger("progress",[e,o.getEstimatedTime()])},500),a?(r.toggleClass(t,"is-chromecast",!0),r.toggleClass(s,"fp-active",!0),e.hijack({pause:function(){o.pause()},resume:function(){o.play()},seek:function(e){var t=new chrome.cast.media.SeekRequest;t.currentTime=e,o.seek(t)}})):(p(),e.trigger("finish",[e]));var l=o.playerState;e.paused&&l===chrome.cast.media.PlayerState.PLAYING&&e.trigger("resume",[e]),e.playing&&l===chrome.cast.media.PlayerState.PAUSED&&e.trigger("pause",[e]),r.toggleClass(t,"is-loading",l===chrome.cast.media.PlayerState.BUFFERING)}})},function(){})},function(e){console.error("requestSession error",e)})})}function u(){console.log("sessionListener")}function c(e){e===chrome.cast.ReceiverAvailability.AVAILABLE&&function(){var e=r.find(".fp-header",t)[0];if(!e)return;r.find(".fp-chromecast",e).forEach(r.removeNode),r.find(".fp-chromecast-engine",t).forEach(r.removeNode),s=r.createElement("a",{class:"fp-chromecast fp-icon",title:"Play on Cast device"}),e.insertBefore(s,r.find(".fp-fullscreen",e)[0]);var n=r.createElement("div",{class:"fp-chromecast-engine"}),i=r.createElement("p",{class:"fp-chromecast-engine-status"}),o=r.createElement("p",{class:"fp-chromecast-engine-icon"});n.appendChild(o),n.appendChild(i);var a=r.find(".fp-engine",t)[0];a?a.parentNode.insertBefore(n,a):r.prepend(r.find(".fp-player",t)[0]||t,n)}()}function f(){}function d(){console.log("onError")}function p(){clearInterval(i),i=null,e.release(),r.toggleClass(t,"is-chromecast",!1),r.toggleClass(s,"fp-active",!1)}})},{"../common":1,"../flowplayer":31,bean:34,scriptjs:45}],10:[function(e,t,n){"use strict";var i=e("../flowplayer"),r=e("../common"),o=e("bean");i(function(e,t){var n=/ ?cue\d+ ?/,i=!1;function a(e){t.className=t.className.replace(n," "),e>=0&&r.addClass(t,"cue"+e)}var s={},l=-.125,u=function(t){a(t.index),e.trigger("cuepoint",[e,t])};function c(t){var n=t&&!isNaN(t.time)?t.time:t;return n<0&&(n=e.video.duration+n),.125*Math.round(n/.125)}e.on("progress",function(e,t,n){if(!i)for(var r=c(n);l<r;)s[l+=.125]&&s[l].forEach(u)}).on("unload",a).on("beforeseek",function(e){setTimeout(function(){e.defaultPrevented||(i=!0)})}).on("seek",function(e,t,n){a(),l=c(n||0)-.125,i=!1,!n&&s[0]&&s[0].forEach(u)}).on("ready",function(t,n,i){l=-.125;var r=i.cuepoints||e.conf.cuepoints||[];e.setCuepoints(r)}).on("finish",function(){for(var t=c(e.video.duration);l<t;)s[l+=.125]&&s[l].forEach(u);l=-.125}),e.conf.generate_cuepoints&&e.bind("load",function(){r.find(".fp-cuepoint",t).forEach(r.removeNode)}),e.setCuepoints=function(t){return e.cuepoints=[],s={},t.forEach(e.addCuepoint),e},e.addCuepoint=function(n){e.cuepoints||(e.cuepoints=[]),"number"==typeof n&&(n={time:n}),n.index=0;var i=c(n);if(s[i]||(s[i]=[]),s[i].push(n),e.cuepoints.length&&(n.index=Math.max.apply(null,e.cuepoints.map(function(e){return e.index}))+1),e.cuepoints.push(n),e.conf.generate_cuepoints&&!1!==n.visible){var a=e.video.duration,l=r.find(".fp-timeline",t)[0];r.css(l,"overflow","visible");var u=n.time||n;u<0&&(u=a+u);var f=r.createElement("a",{className:"fp-cuepoint fp-cuepoint"+n.index});r.css(f,"left",u/a*100+"%"),l.appendChild(f),o.on(f,"mousedown",function(t){t.preventDefault(),t.stopPropagation(),e.seek(u)})}return e},e.removeCuepoint=function(n){"number"==typeof n&&(n=e.cuepoints.filter(function(e){return e.index===n})[0]);var i=e.cuepoints.indexOf(n),o=c(n);if(-1!==i){e.cuepoints=e.cuepoints.slice(0,i).concat(e.cuepoints.slice(i+1));var a=r.find(".fp-timeline",t)[0];r.find(".fp-cuepoint"+n.index,a).forEach(r.removeNode);var l=s[o].indexOf(n);if(-1!==l)return s[o]=s[o].slice(0,l).concat(s[o].slice(l+1)),e}}})},{"../common":1,"../flowplayer":31,bean:34}],11:[function(e,t,n){"use strict";var i=e("../flowplayer"),r=e("bean"),o=e("../common"),a=e("./util/clipboard");i(function(e,t){if(!1!==e.conf.embed&&!1!==e.conf.share){var n=o.find(".fp-share-menu",t)[0],i=o.createElement("a",{class:"fp-icon fp-embed",title:"Copy to your site"},"Embed");o.append(n,i),e.embedCode=function(){var n=e.conf.embed||{},i=e.video,r=n.width||i.width||o.width(t),a=n.height||i.height||o.height(t),s=e.conf.ratio,l='<iframe src="'+e.shareUrl(!0)+'" allowfullscreen style="border:none;';return n.width||n.height?(isNaN(r)||(r+="px"),isNaN(a)||(a+="px"),l+"width:"+r+";height:"+a+';"></iframe>'):(s&&!e.conf.adaptiveRatio||(s=a/r),'<div style="position:relative;width:100%;display:inline-block;">'+l+'position:absolute;top:0;left:0;width:100%;height:100%;"></iframe><div style="padding-top:'+100*s+'%;"></div></div>')},r.on(t,"click",".fp-embed",function(){a(e.embedCode(),function(){e.message("The embed code is now on your clipboard",2e3)},function(){e.textarea(e.embedCode(),"Copy the code below to embed your video")})})}})},{"../common":1,"../flowplayer":31,"./util/clipboard":30,bean:34}],12:[function(e,t,n){"use strict";t.exports=function(e,t){t||(t=document.createElement("div"));var n={},i={},r=function(e,r,o){var a=e.split(".")[0],s=function(l){o&&(t.removeEventListener(a,s),n[e].splice(n[e].indexOf(s),1));var u=[l].concat(i[l.timeStamp+l.type]||[]);r&&r.apply(void 0,u)};t.addEventListener(a,s),n[e]||(n[e]=[]),n[e].push(s)};e.on=e.bind=function(t,n){return t.split(" ").forEach(function(e){r(e,n)}),e},e.one=function(t,n){return t.split(" ").forEach(function(e){r(e,n,!0)}),e};e.off=e.unbind=function(i){return i.split(" ").forEach(function(e){var i=e.split(".").slice(1),r=e.split(".")[0];Object.keys(n).filter(function(e){var t,n=e.split(".").slice(1);return(!r||0===e.indexOf(r))&&(t=n,0===i.filter(function(e){return-1===t.indexOf(e)}).length)}).forEach(function(e){var i=n[e],r=e.split(".")[0];n[e]=i.filter(function(e){return t.removeEventListener(r,e),!1})})}),e},e.trigger=function(n,r,o){if(n){r=(r||[]).length?r||[]:[r];var a,s=document.createEvent("Event");return a=n.type||n,s.initEvent(a,!1,!0),Object.defineProperty&&(s.preventDefault=function(){Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}),i[s.timeStamp+s.type]=r,t.dispatchEvent(s),o?s:e}}},t.exports.EVENTS=["beforeseek","disable","error","finish","fullscreen","fullscreen-exit","load","mute","pause","progress","ready","resume","seek","speed","stop","unload","volume","boot","shutdown"]},{}],13:[function(e,t,n){"use strict";var i=e("../flowplayer"),r=e("../common"),o=e("bean");i(function(e,t){var n=e.conf;if(!1!==n.share&&n.facebook){e.facebook=function(){var e,t,i=screen.height,r=screen.width,o="string"==typeof n.facebook?n.facebook:window.location.toString();e=Math.round(r/2-275),t=0,i>420&&(t=Math.round(i/2-210)),window.open("https://www.facebook.com/sharer.php?s=100&p[url]="+encodeURIComponent(o),"sharer","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,left="+e+",top="+t)};var i=r.find(".fp-share-menu",t)[0],a=r.createElement("a",{class:"fp-icon fp-facebook"},"Facebook");r.append(i,a),o.on(t,"click",".fp-facebook",function(){e.facebook()})}})},{"../common":1,"../flowplayer":31,bean:34}],14:[function(e,t,n){"use strict";var i,r=e("../flowplayer"),o=e("bean"),a=e("../common"),s="fullscreen",l="fullscreen-exit",u=r.support.fullscreen;o.on(document,"fullscreenchange.ffscr webkitfullscreenchange.ffscr mozfullscreenchange.ffscr MSFullscreenChange.ffscr",function(e){var t=document.webkitCurrentFullScreenElement||document.mozFullScreenElement||document.fullscreenElement||document.msFullscreenElement||e.target;if(i||t.parentNode&&t.parentNode.getAttribute("data-flowplayer-instance-id")){var n=i||r(t.parentNode);t&&!i?i=n.trigger(s,[n]):(i.trigger(l,[i]),i=null)}}),r(function(e,t){var n=a.createElement("div",{className:"fp-player"});if(Array.prototype.map.call(t.children,a.identity).forEach(function(e){a.matches(e,".fp-ratio,script")||n.appendChild(e)}),t.appendChild(n),e.conf.fullscreen){var r,o,c,f=window;e.isFullscreen=!1,e.fullscreen=function(t){if(!e.disabled)return void 0===t&&(t=!e.isFullscreen),t&&(r=f.scrollY,o=f.scrollX),u?t?["requestFullScreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"].forEach(function(e){"function"==typeof n[e]&&(n[e](Element.ALLOW_KEYBOARD_INPUT),"webkitRequestFullScreen"!==e||document.webkitFullscreenElement||n[e]())}):["exitFullscreen","webkitCancelFullScreen","mozCancelFullScreen","msExitFullscreen"].forEach(function(e){"function"==typeof document[e]&&document[e]()}):e.trigger(t?s:l,[e]),e},e.on("mousedown.fs",function(){+new Date-c<150&&e.ready&&e.fullscreen(),c=+new Date}),e.on(s,function(){a.addClass(t,"is-fullscreen"),a.toggleClass(t,"fp-minimal-fullscreen",a.hasClass(t,"fp-minimal")),a.removeClass(t,"fp-minimal"),u||a.css(t,"position","fixed"),e.isFullscreen=!0}).on(l,function(){var n;a.toggleClass(t,"fp-minimal",a.hasClass(t,"fp-minimal-fullscreen")),a.removeClass(t,"fp-minimal-fullscreen"),u||"html5"!==e.engine||(n=t.css("opacity")||"",a.css(t,"opacity",0)),u||a.css(t,"position",""),a.removeClass(t,"is-fullscreen"),u||"html5"!==e.engine||setTimeout(function(){t.css("opacity",n)}),e.isFullscreen=!1,f.scrollTo(o,r)}).on("unload",function(){e.isFullscreen&&e.fullscreen()}),e.on("shutdown",function(){i=null,a.removeNode(n)})}})},{"../common":1,"../flowplayer":31,bean:34}],15:[function(e,t,n){"use strict";var i,r,o=e("../flowplayer"),a=e("bean"),s=e("../common");a.on(document,"keydown.fp",function(e){var t=i,n=e.ctrlKey||e.metaKey||e.altKey,r=e.which,o=t&&t.conf;if(t&&o.keyboard&&!t.disabled&&!n&&t.ready){if(e.shiftKey)return 39==r?t.speed(!0):37==r&&t.speed(!1),e.preventDefault();if(r<58&&r>47)return e.preventDefault(),t.seekTo(r-48);(function(){switch(r){case 38:case 75:return t.volume(t.volumeLevel+.15),!0;case 40:case 74:return t.volume(t.volumeLevel-.15),!0;case 39:case 76:return t.seeking=!0,t.seek(!0),!0;case 37:case 72:return t.seeking=!0,t.seek(!1),!0;case 190:return t.seekTo(),!0;case 32:return t.toggle(),!0;case 70:return o.fullscreen&&t.fullscreen(),!0;case 77:return t.mute(),!0;case 81:return t.unload(),!0}})()&&e.preventDefault()}}),o(function(e,t){e.conf.keyboard&&(a.on(document,"click",function(n){if(s.hasParent(n.target,t))i=e.disabled?0:e;else{if(i!==e)return;i=0}i&&(r=t)}),e.bind("shutdown",function(){r==t&&(r=null)}))})},{"../common":1,"../flowplayer":31,bean:34}],16:[function(e,t,n){var i=e("../flowplayer"),r=e("../common"),o=e("bean");i(function(e,t){e.showMenu=function(n,i){var a=r.find(".fp-ui",t)[0];r.toggleClass(n,"fp-active",!0),setTimeout(function(){o.one(document,"click",function(){e.hideMenu(n)})});var s=i;if(i&&i.tagName&&(s={left:r.offset(i).left,rightFallbackOffset:r.width(i),top:r.offset(i).top+r.height(i)}),!s)return r.css(n,"top","auto");s.rightFallbackOffset=s.rightFallbackOffset||0;var l=s.top-r.offset(a).top,u=s.left-r.offset(a).left;r.width(n)+u>r.width(a)&&(u=u-r.width(n)+s.rightFallbackOffset),r.height(n)+l>r.height(a)&&(l-=r.height(n)),r.css(n,{top:l+"px",left:u+"px",right:"auto"})},e.hideMenu=function(e){r.toggleClass(e,"fp-active",!1),r.css(e,{top:"-9999em"})}})},{"../common":1,"../flowplayer":31,bean:34}],17:[function(e,t,n){var i=e("../flowplayer"),r=e("../common"),o=e("bean");i(function(e,t){var n=r.find(".fp-header",t)[0],i=r.find(".fp-ui",t)[0];e.message=function(e,t){var o,a,s=(o=e,a=r.createElement("div",{className:"fp-message"},o),i.insertBefore(a,n),setTimeout(function(){r.toggleClass(a,"fp-shown")}),a),l=function(){r.toggleClass(s,"fp-shown"),setTimeout(function(){var e;e=s,r.removeNode(e)},500)};return t&&setTimeout(l,t),l},e.textarea=function(e){var t=document.createElement("textarea");t.value=e,t.className="fp-textarea",i.appendChild(t),o.on(document,"click.fptextarea",function(e){if(e.target===t)return t.select();e.stopPropagation(),e.preventDefault(),r.removeNode(t),o.off(document,"click.fptextarea")})}})},{"../common":1,"../flowplayer":31,bean:34}],18:[function(e,t,n){"use strict";var i=e("../flowplayer"),r=/IEMobile/.test(window.navigator.userAgent),o=e("../common"),a=e("bean"),s=e("./ui").format,l=i.support,u=window.navigator.userAgent;(l.touch||r)&&i(function(e,t){var n=l.android,i=n&&!n.firefox,c=/Silk/.test(u),f=n.version||0;if(i&&!r){if(!/Chrome/.test(u)&&f<4||n.samsung&&f<5){var d=e.load;e.load=function(){var n=d.apply(e,arguments);return o.find("video.fp-engine",t)[0].load(),e.trigger("ready",[e,e.video]),n}}var p,h=0,g=function(e){p=setInterval(function(){e.video.time=++h,e.trigger("progress",[e,h])},1e3)};e.on("ready pause unload",function(){p&&(clearInterval(p),p=null)}),e.on("ready",function(){h=0}),e.on("resume",function(t,n){if(n.live)return h?g(n):void e.one("progress",function(e,t,n){0===n&&g(t)})})}l.volume||(o.removeClass(t,"fp-mute"),o.addClass(t,"no-volume")),l.iOS&&o.addClass(t,"fp-mute"),o.addClass(t,"is-touch"),e.sliders&&e.sliders.timeline&&e.sliders.timeline.disableAnimation();var m=!1;a.on(t,"touchmove",function(){m=!0});var v=!0;if(a.on(t,"touchend click",function(n){if(m)m=!1;else{var i=o.find("video.fp-engine",t)[0];if(v&&e.conf.clickToUnMute&&i&&i.muted&&e.conf.autoplay&&(i.muted=!1),v=!1,e.playing&&!o.hasClass(t,"is-mouseover"))return o.addClass(t,"is-mouseover"),o.removeClass(t,"is-mouseout"),n.preventDefault(),void n.stopPropagation();e.playing||e.splash||!o.hasClass(t,"is-mouseout")||o.hasClass(t,"is-mouseover")||setTimeout(function(){e.disabled||e.playing||e.splash||o.find("video.fp-engine",t)[0].play()},400)}}),!l.fullscreen&&e.conf.native_fullscreen&&"function"==typeof o.createElement("video").webkitEnterFullScreen){var y=e.fullscreen;e.fullscreen=function(){var n=o.find("video.fp-engine",t)[0];if(!n)return y.apply(e);e.trigger("fullscreen",[e]),a.on(document,"webkitfullscreenchange.nativefullscreen",function(){document.webkitFullscreenElement===n&&(a.off(document,".nativefullscreen"),a.on(document,"webkitfullscreenchange.nativefullscreen",function(){document.webkitFullscreenElement||(a.off(document,".nativefullscreen"),e.trigger("fullscreen-exit",[e]))}))}),n.webkitEnterFullScreen(),a.one(n,"webkitendfullscreen",function(){a.off(document,"fullscreenchange.nativefullscreen"),e.trigger("fullscreen-exit",[e]),o.prop(n,"controls",!0),o.prop(n,"controls",!1)})}}(i||c)&&e.bind("ready",function(){var n=o.find("video.fp-engine",t)[0];e.conf.splash&&n.paused&&"hlsjs-lite"!==e.engine.engineName&&(a.one(n,"canplay",function(){n.play()}),n.load()),e.bind("progress.dur",function(){if(!e.live&&!e.conf.live){var i=n.duration;1!==i&&(e.video.duration=i,o.find(".fp-duration",t)[0].innerHTML=s(i),e.unbind("progress.dur"))}})})})},{"../common":1,"../flowplayer":31,"./ui":27,bean:34}],19:[function(e,t,n){"use strict";var i=e("../flowplayer"),r=e("extend-object"),o=e("bean"),a=e("../common"),s=e("./resolve"),l=new s,u=window.jQuery,c=/^#/;i(function(e,t){var n=r({active:"is-active",advance:!0,query:".fp-playlist a"},e.conf),i=n.active,f=a.find(".fp-ui",t)[0],d=a.hasClass(t,"fp-custom-playlist")||!!n.customPlaylist;function p(){return a.find(n.query,h())}function h(){if(!c.test(n.query))return t}function g(){return a.find(n.query+"."+i,h())}function m(){var n=a.find(".fp-playlist",t)[0];if(!n){n=a.createElement("div",{className:"fp-playlist"});var r=a.find(".fp-next,.fp-prev",t);r.length?r[0].parentElement.insertBefore(n,r[0]):a.insertAfter(t,a.find("video",t)[0],n)}n.innerHTML="",e.conf.playlist[0].length&&(e.conf.playlist=e.conf.playlist.map(function(e){if("string"==typeof e){var t=e.split(s.TYPE_RE)[1];return{sources:[{type:"m3u8"===t.toLowerCase()?"application/x-mpegurl":"video/"+t,src:e}]}}return{sources:e.map(function(e){var t={};return Object.keys(e).forEach(function(n){t.type=/mpegurl/i.test(n)?"application/x-mpegurl":"video/"+n,t.src=e[n]}),t})}})),e.conf.playlist.forEach(function(t,r){var o=t.sources[0].src;n.appendChild(a.createElement("a",{href:o,className:e.video.index===r?i:void 0,"data-index":r}))})}a.toggleClass(t,"fp-custom-playlist",d),a.toggleClass(t,"fp-default-playlist",!d),e.play=function(t){if(void 0===t)return e.resume();if("number"==typeof t&&!e.conf.playlist[t])return e;if("number"!=typeof t)return e.load.apply(null,arguments);var n=r({index:t},e.conf.playlist[t]);return e.off("beforeresume.fromfirst"),"number"==typeof t&&t===e.video.index?e.seek(0,function(){e.resume()}):(e.load(n,function(){e.video.index=t}),e)},e.next=function(t){t&&t.preventDefault();var n=e.video.index;return-1!=n&&(n=n===e.conf.playlist.length-1?0:n+1,e.play(n)),e},e.prev=function(t){t&&t.preventDefault();var n=e.video.index;return-1!=n&&(n=0===n?e.conf.playlist.length-1:n-1,e.play(n)),e},e.setPlaylist=function(t,n){return e.conf.playlist=t,n||delete e.video.index,m(),e},e.addPlaylistItem=function(t){return delete e.video.is_last,e.setPlaylist(e.conf.playlist.concat([t]),!0)},e.removePlaylistItem=function(t){var n=e.conf.playlist;return e.setPlaylist(n.slice(0,t).concat(n.slice(t+1)))},o.on(t,"click",".fp-next",e.next),o.on(t,"click",".fp-prev",e.prev),e.off("finish.pl").on("finish.pl",function(e,i){if(void 0===i.conf.advance||i.conf.advance){if(i.video.loop)return i.seek(0,function(){i.resume()});var r=i.video.index>=0?i.video.index+1:void 0;r<i.conf.playlist.length||n.loop?(r=r===i.conf.playlist.length?0:r,a.removeClass(t,"is-finished"),setTimeout(function(){i.play(r)})):i.conf.playlist.length>1&&(i.one("beforeresume.fromfirst",function(e){e.preventDefault(),i.play(0)}),i.one("seek",function(){i.off("beforeresume.fromfirst")}))}});var v=!1;e.conf.playlist.length&&(v=!0,m(),e.conf.clip&&e.conf.clip.sources.length||(e.conf.clip=e.conf.playlist[e.conf.startIndex||0])),p().length&&!v&&(e.conf.playlist=[],delete e.conf.startIndex,p().forEach(function(t){var n=t.href;t.setAttribute("data-index",e.conf.playlist.length);var i=l.resolve(n,e.conf.clip.sources);u&&r(i,u(t).data()),e.conf.playlist.push(i)})),a.find(".fp-prev,.fp-next,.fp-playlist",t).forEach(function(e){f.appendChild(e)}),o.on(c.test(n.query)?document:t,"click",n.query,function(t){t.preventDefault();var n=t.currentTarget,i=Number(n.getAttribute("data-index"));-1!=i&&e.play(i)}),e.on("load",function(r,o,s){if(e.conf.playlist.length){var l,u=g()[0],c=u&&u.getAttribute("data-index"),f=s.index=void 0!==(l=s).index?l.index:void 0!==e.video.index?e.video.index:e.conf.startIndex||0,d=a.find(n.query+'[data-index="'+f+'"]',h())[0],p=f==e.conf.playlist.length-1;u&&a.removeClass(u,i),d&&a.addClass(d,i),a.removeClass(t,"video"+c),a.addClass(t,"video"+f),a.toggleClass(t,"last-video",p),s.index=o.video.index=f,s.is_last=o.video.is_last=p}}).on("unload.pl",function(){e.conf.playlist.length&&(g().forEach(function(e){a.to