@flowplayer/player
Version:
video player for the future
2 lines (1 loc) • 1.51 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=e.flowplayer||{},e.flowplayer.message=t())}(this,function(){"use strict";const e="message:show",t="message:dismiss";var n,s=Object.freeze({__proto__:null,SHOW_MESSAGE:e,DISMISS_MESSAGE:t});const o=/<trans(.*)trans>/,i=((n=class Message{init(s,i,a){let f="";a.on(e,function(e){var n,s,l;const r=null===(n=e.data)||void 0===n?void 0:n.sticky,u=null===(s=e.data)||void 0===s?void 0:s.timeout;let d=(null===(l=e.data)||void 0===l?void 0:l.message)||"";if(d==f)return;if(f=d||"",o.test(d)){const e=(o.exec(d)||["",""])[1].trim();d=a.i18n(e,e)}const c=document.createElement("div");c.classList.add("fp-message");const p=document.createElement("p");p.innerText=d,c.append(p),i.append(c),setTimeout(function(){c.classList.add("fp-shown")},100),r||setTimeout(function(){a.emit(t,c)},u)}),a.on(t,function(e){f="";const t=e.data;t&&(t.classList.remove("fp-shown"),setTimeout(function(){t.remove()},1e3))}),a.message={events:n.events}}}).pluginName="message",n.events=s,n);return function(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;if(null===document.currentScript)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const n=e.flowplayer;return"function"==typeof n?(n(t),t):(Array.isArray(n.extensions)||(n.extensions=[]),~n.extensions.indexOf(t)||n.extensions.push(t),t)}(window,i)});