UNPKG

flowplayer-files

Version:

Flowplayer js and css files for v2.5.9 after the reboot of flowplayer

2 lines (1 loc) 8 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):((t=t||self).flowplayer=t.flowplayer||{},t.flowplayer.speed=e())}(this,(function(){"use strict";var t=[].slice;function e(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];for(var i in e)t[i]=e[i];return t}function n(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.slice(1).reduce((function(t,n){return e(t,n)}),t[0]||{})}function r(t,e,n){for(var r=function(t){return Array.isArray(t)?t.slice(0):t.split(".")}(e);r.length;){if(null==t)return n;var i=r.shift();if("string"!=typeof i)return n;t=t[i]}return null==t?n:t}var i=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassive",null,e),window.removeEventListener("testPassive",null,e)}catch(t){}return t}()&&{passive:!0},o=["touchstart","touchmove"];function a(t){return t.emit=function(n,r,i){i=i||{};var o=function(t){var e=document.createEvent("Event");return e.initEvent(t,!1,!0),e}(n);return r&&e(o,{data:r||{}}),t.dispatchEvent(o),!1===i.return_self?o:t},t.on=function(e,n){return"string"==typeof e&&(e=e.split(" ")),e.forEach((function(e){return function(t){return~o.indexOf(t)}(e)?t.addEventListener(e,n,i):t.addEventListener(e,n)})),t},t.off=function(e,n){return t.removeEventListener(e,n),t},t.one=t.once=function(e,n){return t.on(e,(function r(i){t.off(e,r),n(i)}))},t}var s=Array.isArray,u="undefined"!=typeof window&&a(window),f="undefined"!=typeof document&&a(document),c=["span","a","em","p","i"],l=c.concat(["div","strong","video","img","ol","ul","li","script"]);function d(t,e,n){var r=v(document.createElement(t));if(s(e)&&(n=e,e=!1),s(n)||(n=[n]),r.append(n.filter((function(t){return t}))),"object"!=typeof e)return r;for(var i in e)i in r?r[i]=e[i]:r.setAttribute(i,e[i]);return r}function p(e){var n=e.tagName;e.__flowplayer__=1,e.find=function(t){var n=e.querySelector(t);return n?v(n):n},e.html=function(t){return e.innerHTML=t,e},e.empty=function(){return e.innerHTML="",e},e.offset=function(){var t={top:0,left:0},n=e;do{t.left+=n.offsetLeft||0,t.top+=n.offsetTop||0}while(n=n.offsetParent);return t},e.innerWidth=function(){var t=getComputedStyle(e);return e.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)};var r=e.insert=function(t,n){return s(n)?n.map((function(n){return e.insert(t,n)}))[0]:v(n="string"==typeof n?e.insertAdjacentHTML(t,n):e.insertAdjacentElement?e.insertAdjacentElement(t,n):e.appendChild(n))};return e.append=r.bind(e,"beforeend"),e.prepend=r.bind(e,"afterbegin"),e.css=function(t,n){if("object"==typeof t){for(var r in t)e.css(r,t[r]);return e}return void 0===n?getComputedStyle(e)[t]:(1*n&&(n+="px"),e.style[t]=n,e)},e.show=function(){return e.css({display:~c.indexOf(n)?"inline":"block"})},e.hide=function(){return e.css({display:"none"})},e.remove=function(){var t=e.parentNode;t&&t.removeChild(e)},e.attr=function(t,n){return null==n?e.getAttribute(t):(e.setAttribute(t,n),e)},e.txt=function(t){return e.textContent=t,e},e.fp=function(t){return e.addClass("fp-"+t)},e.addClass=function(t){return t.split(" ").forEach((function(t){e.hasClass(t)||(e.className+=(e.className?" ":"")+t)})),e},e.removeClass=function(t){t=t.split(" ");var n=e.className.split(" ");return e.className=n.filter((function(e){return!~t.indexOf(e)})).join(" "),e},e.toggleClass=function(t,n){return void 0===n&&(n=!e.hasClass(t)),n?e.addClass(t):e.removeClass(t)},e.findAll=function(n){return r=e.querySelectorAll(n),t.call(r);var r},e.hasClass=function(t){return~e.className.split(" ").indexOf(t)},e}function v(t){return void 0===t||function(t){return t&&t.__flowplayer__}(t)?t:p(a(t))}function m(t,e){if("string"==typeof t&&"<"==t[0])return d(t.slice(1,-1),e);if("string"!=typeof t)return v(t);var n=e instanceof HTMLElement&&e.querySelector(".fp-"+t)||document.querySelector(t);return n?v(n):void 0}function y(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function h(t){var e,n,r=y("svg");return r.setAttribute("viewBox",t.coords),t.name&&r.setAttribute("class",t.name),t.title&&r.setAttribute("title",t.title),t.title&&r.setAttribute("aria-label",t.title),r.setAttribute("tabindex","0"),r.setAttribute("focusable","true"),r.appendChild((e=t.link,(n=y("use")).setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e),n)),m(r)}m.window=u,m.document=f,m.el=d,l.forEach((function(t){m[t]=function(e,n){return"string"==typeof e&&(e={class:e}),d(t,e,n)}}));var x={TOGGLE_OPEN:"menu:toggle:open",RENDER:"menu:render",PUSH:"menu:push"},g={ON:"fp-on",INVIS:"fp-invis"};function E(t,e,r){var i=r.id||"menu-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5);return r=r||{},t.attr("role","button").attr("aria-haspopup","true").attr("aria-expanded","false").attr("aria-controls",i).attr("aria-label",r.title),r.options=r.options||[],r.id=i,E._interface(t,e,n({},r))}E.title=function(t){return m("<h3>").txt(t)},E.close=function(t){return m.span("fp-close").on("click",t).html("&times;")},E.option=function(t,e){var n=this,r=m("<li>").attr("tabindex","0").attr("role","menuitem"),i=n._attrs;t.icon&&r.append(h(t.icon)),r.append(m("<span>").txt(t.text)),r.on("click",(function(r){i.multi||n.options().forEach(E.off),n.activate(e),"function"==typeof t.onclick&&t.onclick(r,t,e,n)})),r.idx=e,n.append(r)},E._interface=function(t,e,n){t.addClass("fp-menu-container");var i=m("<ul>").attr("id",n.id).addClass("fp-menu").attr("role","menu");return n.icons&&i.addClass("fp-icons"),i._attrs=n,t.on("click",(function(t){setTimeout((function(){if(!t.defaultPrevented)return i.hasClass(g.ON)?e.emit(x.TOGGLE_OPEN,{menu:i,open:!1}):void e.emit(x.TOGGLE_OPEN,{menu:i,open:!0})}),0)})),i.on("mouseleave",(function(){e.emit(x.TOGGLE_OPEN,{menu:i,open:!1})})),e.on(x.TOGGLE_OPEN,(function(n){if(r(n,"data.menu")!==i)return i.toggleClass(g.ON,!1),t.attr("aria-expanded","false");var o=r(n,"data.open",!1);if(i.toggleClass(g.ON,o),t.attr("aria-expanded",o?"true":"false"),e.hasClass("is-accessibility"))if(o){var a=i.options()[0];a&&a.focus()}else t.focus()})),i.push=function(t){return i._attrs.options=r(i,"_attrs.options",[]),i._attrs.options.push(t),i.render()},i.select=function(t){return i.render(i.options.filter(t))},i.render=function(e){var n=i._attrs;return i.empty(),i.prepend(E.close()),n.title&&i.prepend(E.title(n.title)),n.options=e||n.options,n.options.forEach(E.option,i),t.toggleClass(g.INVIS,0==n.options.length),i._activate(),i},i.close=function(){i.hasClass(g.ON)&&e.emit(x.TOGGLE_OPEN,{menu:i,open:!1})},i._activate=function(){i.options().forEach((function(t){t.toggleClass(g.ON,t.idx===i.idx)}))},i.options=function(){return[].slice.call(i.querySelectorAll("li"))},i.activate=function(t,e){void 0===i.idx||i.idx!==t||e?i.idx=t:delete i.idx,i._activate()},i.deactivate=function(){i.activate(i.idx)},i.render(n.options),t.appendChild(i),i},E.on=function(t){return t.addClass(g.ON),t},E.off=function(t){return t.removeClass(g.ON),t},E.CONTAINER_CLASS="fp-menu",E.Events=x,E.States=g;var b=[.2,.5,1,2,10];function w(t,e,n,r,i){var o=i._attrs.options[r].rate;t.root.find(".fp-speed.fp-menu-container").childNodes[0].nodeValue=o+"x",isNaN(o)||(t.playbackRate=o)}return function(t,e){if("object"==typeof exports&&"undefined"!=typeof module)return e;"flowplayer"in t||(t.flowplayer={extensions:[]});var n=t.flowplayer;return"function"==typeof n?(n(e),e):(Array.isArray(n.extensions)||(n.extensions=[]),~n.extensions.indexOf(e)||n.extensions.push(e),e)}(window,(function(t,e,i){var o=void 0,a=m.span("fp-speed fp-menu-container").txt("1x").attr("tabindex","0"),s=E(a,e,{title:i._t("speed.menu_title"),options:[]});i.on("config",(function(){var e=r(t,"speed",!0);if(e!==o){if(o=e,0==e)return s.render([]);var a=r(t,"speed.options",b),u=r(t,"speed.labels",[]);s.render(a.map((function(t,e){var r=t+"x";return n({},t,{text:u[e]||r,rate:t,onclick:w.bind(0,i)})})))}})),i.on("mount",(function(){e.controls&&e.controls.append(a)}))}))}));