@flowplayer/player 3.35.0-rc → 3.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/core.js +1 -1
  2. package/default.js +1 -1
  3. package/embed.js +2 -2
  4. package/package.json +1 -2364
  5. package/plugins/ads.js +1 -1
  6. package/plugins/analytics.js +1 -1
  7. package/plugins/rts.js +1 -1
  8. package/plugins/ssai.js +1 -1
  9. package/package/core/events.d.ts +0 -710
  10. package/package/core/events.js +0 -403
  11. package/package/core.js +0 -1
  12. package/package/default.js +0 -1
  13. package/package/embed.js +0 -7
  14. package/package/flowplayer.css +0 -1
  15. package/package/index.d.ts +0 -2238
  16. package/package/plugins/ads.d.ts +0 -4468
  17. package/package/plugins/ads.js +0 -7
  18. package/package/plugins/airplay.d.ts +0 -2152
  19. package/package/plugins/airplay.js +0 -1
  20. package/package/plugins/analytics.d.ts +0 -2146
  21. package/package/plugins/analytics.js +0 -1
  22. package/package/plugins/asel.d.ts +0 -2293
  23. package/package/plugins/asel.js +0 -1
  24. package/package/plugins/audio.d.ts +0 -2146
  25. package/package/plugins/audio.js +0 -1
  26. package/package/plugins/chapters.d.ts +0 -2155
  27. package/package/plugins/chapters.js +0 -1
  28. package/package/plugins/chromecast.d.ts +0 -2221
  29. package/package/plugins/chromecast.js +0 -1
  30. package/package/plugins/comscore.d.ts +0 -2146
  31. package/package/plugins/comscore.js +0 -1
  32. package/package/plugins/consent.d.ts +0 -2194
  33. package/package/plugins/consent.js +0 -1
  34. package/package/plugins/context-menu.d.ts +0 -2160
  35. package/package/plugins/context-menu.js +0 -1
  36. package/package/plugins/cuepoints.d.ts +0 -2270
  37. package/package/plugins/cuepoints.js +0 -1
  38. package/package/plugins/dash.d.ts +0 -2302
  39. package/package/plugins/dash.js +0 -2
  40. package/package/plugins/drm.d.ts +0 -2271
  41. package/package/plugins/drm.js +0 -1
  42. package/package/plugins/endscreen.d.ts +0 -2165
  43. package/package/plugins/endscreen.js +0 -1
  44. package/package/plugins/fas.d.ts +0 -2200
  45. package/package/plugins/fas.js +0 -1
  46. package/package/plugins/float-on-scroll.d.ts +0 -2234
  47. package/package/plugins/float-on-scroll.js +0 -1
  48. package/package/plugins/ga4.d.ts +0 -2146
  49. package/package/plugins/ga4.js +0 -1
  50. package/package/plugins/gemius.d.ts +0 -2171
  51. package/package/plugins/gemius.js +0 -1
  52. package/package/plugins/google-analytics.d.ts +0 -2146
  53. package/package/plugins/google-analytics.js +0 -1
  54. package/package/plugins/hls.d.ts +0 -2271
  55. package/package/plugins/hls.js +0 -1
  56. package/package/plugins/id3.d.ts +0 -2212
  57. package/package/plugins/id3.js +0 -1
  58. package/package/plugins/iframe.d.ts +0 -2147
  59. package/package/plugins/iframe.js +0 -1
  60. package/package/plugins/keyboard.d.ts +0 -2146
  61. package/package/plugins/keyboard.js +0 -1
  62. package/package/plugins/media-session.d.ts +0 -2146
  63. package/package/plugins/media-session.js +0 -1
  64. package/package/plugins/message.d.ts +0 -2205
  65. package/package/plugins/message.js +0 -1
  66. package/package/plugins/ovp.d.ts +0 -2208
  67. package/package/plugins/ovp.js +0 -1
  68. package/package/plugins/playlist.d.ts +0 -2465
  69. package/package/plugins/playlist.js +0 -1
  70. package/package/plugins/preview.d.ts +0 -2236
  71. package/package/plugins/preview.js +0 -1
  72. package/package/plugins/qsel.d.ts +0 -2236
  73. package/package/plugins/qsel.js +0 -1
  74. package/package/plugins/qul.d.ts +0 -2161
  75. package/package/plugins/qul.js +0 -1
  76. package/package/plugins/rts.d.ts +0 -2551
  77. package/package/plugins/rts.js +0 -25
  78. package/package/plugins/share.d.ts +0 -2181
  79. package/package/plugins/share.js +0 -1
  80. package/package/plugins/speed.d.ts +0 -2173
  81. package/package/plugins/speed.js +0 -1
  82. package/package/plugins/ssai.d.ts +0 -2502
  83. package/package/plugins/ssai.js +0 -7
  84. package/package/plugins/subtitles.d.ts +0 -2287
  85. package/package/plugins/subtitles.js +0 -1
  86. package/package/plugins/thumbnails.d.ts +0 -2164
  87. package/package/plugins/thumbnails.js +0 -1
  88. package/package/plugins/tizen.d.ts +0 -2152
  89. package/package/plugins/tizen.js +0 -1
  90. package/package/plugins/vtsel.d.ts +0 -2250
  91. package/package/plugins/vtsel.js +0 -1
  92. package/package/plugins/webos.d.ts +0 -2152
  93. package/package/plugins/webos.js +0 -1
  94. package/package/util/loader.d.ts +0 -2163
  95. package/package/util/loader.js +0 -63
@@ -1 +0,0 @@
1
- !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.chapters=t())}(this,function(){"use strict";function e(){}var t;function n(e,n){if(function(e){return Object.values(t).includes(e)}(n=n||t.Anonymous))return e instanceof HTMLVideoElement&&(e.poster="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),"crossOrigin"in e?e.crossOrigin=n:e.setAttribute("crossorigin",n),e}function r(e){const t=document.createElement("a");return t.href=e,t.origin}function i(t,i){const s=document.createElement("track");s.className="fp-track renderable",s.kind=i.kind||"captions",s.label=i.label||i.lang||"",s.lang=i.lang||"",s.id=["fp",i.lang].join("-");const o=s.track;return o.removeCue=e,"string"!=typeof i.crossorigin&&function(e,t){try{return e.src.startsWith("blob:"),r(e.src)!==r(t)}catch(e){return console.error(e),!0}}(t,i.src)&&(n(t),i.crossorigin=t.getAttribute("crossorigin")),"crossorigin"in i&&n(t,i.crossorigin),Object.keys(i).forEach(e=>{"default"!==e&&(s[e]=i[e])}),o.mode=i.default?"hidden":"disabled",t.appendChild(s),s}!function(e){e.Anonymous="anonymous",e.UseCredentials="use-credentials",e.Empty=""}(t||(t={}));const s="mousemove",o="durationchange",a="config",c="chapter:changed",l="chapters:new";var u=Object.freeze({__proto__:null,CHAPTER_CHANGED:c,CHAPTERS_NEW:l});function d(e,t,n){const r=function(e,t){const n=new CustomEvent(e,{detail:t,cancelable:!0});return t&&Object.defineProperty(n,"data",{get:()=>t}),n}(t,n);return e.dispatchEvent(r),e}function h(e,t){const n=e._customElements.get(t);return n&&e.root.querySelector(n)||void 0}function p(...e){const t=document.createElement("div");return 0==e.length||t.classList.add(...e),t}!function(){let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}}();const f="flowplayer-timeline-bar",m="is-source-processing",_=(e,t,n,r)=>{e.customElements.get(t)===t&&(((e,t,n)=>{window.customElements.get(t)||window.customElements.define(t,n),e.customElements.get(t)||e.customElements.set(t,t)})(e,n,r),e.customElements.set(t,n))};class FlowplayerComponent extends HTMLElement{constructor(e){super(),this.player=e}}document.addEventListener("click",function(e){this.active_menu&&!e.composedPath().includes(this.active_menu)&&(Array.from(document.querySelectorAll(".fp-engine")).forEach(e=>{var t;const n=e.root.querySelector("details[open].fp-menu-container");n&&(n.open=!1,null===(t=n.querySelector("summary"))||void 0===t||t.removeAttribute("aria-expanded"),e.root.classList.toggle("has-menu-opened",!1))}),this.active_menu=void 0)});const v={passive:!0};var g;function y(t,n){let r=0,i=-1,o=-1;const a=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5),c=t.classList;t.id=a,c.remove(g.GRABBING),c.remove(g.TOUCHING);const l=n.onseek||e,u=n.onstart||e,d=n.onend||e,h=n.onmouse||e,p=n.ontouch||e,f=n.ontouchend||e;function m(e){!function(){const e=t.getBoundingClientRect();r=e.left,i=e.width}();let n=(function(e){return"function"==typeof window.TouchEvent&&e instanceof TouchEvent}(e)?e.changedTouches[0].pageX:e.pageX)-r;return n>i&&(n=i),n<0&&(n=0),n/i*100}function _(e){const n=m(e);n!=o&&(l(t,n),o=n)}return t.addEventListener("touchstart",function(e){E(t,e)&&(c.add(g.TOUCHING),b(t.parentElement)&&(c.add(g.GRABBING),p(t,m(e)),u(t,m(e)),_(e)))},v),t.addEventListener("touchmove",function(e){_(e),h(t,m(e))},v),t.addEventListener("touchend",function(e){setTimeout(function(){c.remove(g.TOUCHING)},500),E(t,e)&&(c.remove(g.GRABBING),f(t,m(e)),d(t,m(e)),i=0)},v),t.addEventListener("touchcancel",function(){c.remove(g.GRABBING,g.TOUCHING),i=0},v),t.addEventListener("mousedown",function(e){c.contains(g.TOUCHING)||(document.addEventListener(s,_),c.add(g.GRABBING),u(t,m(e)),e.preventDefault(),_(e))}),t.addEventListener(s,function(e){c.contains(g.TOUCHING)||h(t,m(e))}),document.addEventListener("mouseup",function(e){c.contains(g.TOUCHING)||(document.removeEventListener(s,_),c.contains(g.GRABBING)&&(c.remove(g.GRABBING),d(t,m(e)),i=0))}),t}function E(e,t){const n=t.target;return!!n&&(n&&!n.closest(e.id)||!b(e.parentElement)||!e.classList.contains(g.TOUCHING))}function b(e){if(!e)return!1;const t=window.getComputedStyle(e);return"0"!==t.width&&"0"!==t.height&&"0"!==t.opacity&&"none"!==t.display&&"hidden"!==t.visibility}function A(e){const t="number"==typeof e?e:parseInt(e,10);return(t>9?"":"0")+t}function w(e){if(isNaN(e)||e>=Number.MAX_SAFE_INTEGER)return"";const t=e<0?"-":"";e=Math.round(Math.abs(e));const n=Math.floor(e/3600);let r=Math.floor(e/60);return e-=60*r,n>=1?(r-=60*n,t+n+":"+A(r)+":"+A(e)):t+A(r)+":"+A(e)}function k(e,t){if(!e.parentElement)return;const n=e.clientWidth/e.parentElement.clientWidth*100/2;e.style.left=t-n+"%",e.style.display="block"}function T(e,t){if(isNaN(e.duration))return;const n=e.buffered;n.length&&(t.style.width=Math.min(n.end(n.length-1)/e.duration*100,100)+"%")}function N(e,t){e.style.width="0",t.style.display="none"}!function(e){e.GRABBING="has-grab",e.TOUCHING="has-touch"}(g||(g={}));const C="is-chromecast-playing";function B(e,t){const n=e.seekable;if("object"!=typeof e.opts||0==n.length)return{head:0,tail:0};const r=function(e){var t;const n=e.seekable;return n.length?e.hasState(C)||!(null===(t=e.hls)||void 0===t?void 0:t.liveSyncPosition)?n.end(n.length-1):e.hls.liveSyncPosition:0}(e),i=t||e.live_state.dvr_window;return{head:r,tail:"number"!=typeof i||r-i<0?n.start(0):r-i}}function G(e,t,n){if(!t.seekable||0==t.seekable.length)return;k(n,e);const r=B(t),i=(100-Math.max(0,Math.min(e,100)))/100*(r.head-r.tail);n.innerText="-"+w(i)}function L(e,t){e/=100,t.currentTime=function(e,t){if(t>1||t<0)return console.warn("cannot calculate a percent outside of range(0..1)"),0;const n=B(e);return n.tail+t*(n.head-n.tail)}(t,e)}function S(e,t){e.style.width="0",t.style.display="none"}class FlowplayerTimelineBar extends FlowplayerComponent{constructor(e){let t;super(e),this.bufferEle=p("fp-buffer"),this.progress=p("fp-progress","fp-color"),this.tooltipEle=p("fp-timestamp"),this.proposedSeekBar=p("fp-hover"),this.dragger=p("fp-dragger","fp-color"),this.classList.add("fp-timeline","fp-bar"),this.tooltipEle.style.display="none",this.setAttribute("role","slider"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",e.i18n("core.timeline_aria_label","Seek slider")),this.setAttribute("aria-valuenow","0"),this.progress.append(this.dragger),this.append(this.bufferEle,this.progress,this.proposedSeekBar,this.tooltipEle);const n=requestAnimationFrame;let r;const i=()=>{var n;0==e.reaper||t.live||(n=e,this.progress.style.width=n.currentTime/n.duration*100+"%",r=void 0,e.paused||this.classList.contains(g.GRABBING)||r||(r=setTimeout(i,200)))},s=()=>!!this.player.opt("seekable",!0)&&!isNaN(this.player.duration);y(this,{onseek:(n,r)=>{if(s())switch(!!t.live){case!0:G(r,e,this.tooltipEle);break;case!1:!function(e,t,n){const r=t.duration*(e/100);if(t.disabled&&r>t.currentTime)return!1;n.style.width=e+"%",t.currentTime=r}(r,e,this.progress),k(this.tooltipEle,r)}},onstart:()=>{s()&&(e.emit("timeline/gesture/start"),!e.hasState("is-casting")&&e.setState("is-seeking",!0),t.live||function(e){e.style.display="block"}(this.tooltipEle))},onend:function(r,s){n(i),0!=t.seekable&&t.live&&L(s,e)},ontouchend:()=>{t.live?S(this.proposedSeekBar,this.tooltipEle):N(this.proposedSeekBar,this.tooltipEle),setTimeout(()=>e.emit("timeline/gesture/end"),0)},onmouse:(n,r)=>{if(s()&&(e.emit("timeline/gesture/move",{percent:r}),!this.classList.contains(g.GRABBING)))switch(!!t.live){case!0:!function(e,t){t.style.width=e+"%"}(r,this.proposedSeekBar),G(r,e,this.tooltipEle);break;case!1:!function(e,t){t.style.width=e+"%"}(r,this.proposedSeekBar),function(e,t,n){isNaN(e)||isNaN(t.duration)||(k(n,e),n.textContent=w(e/100*t.duration))}(r,e,this.tooltipEle)}}}),e.on(a,function(e){e.data&&(t=e.data)}),e.on("playing",()=>n(i)),e.on("progress",()=>{0==e.reaper||t.live||T(e,this.bufferEle)}),e.on("dvr",e=>{this.progress.style.width=e.detail+"%"}),e.on("timeupdate",()=>{0!=e.reaper&&(n(i),this.setAttribute("aria-valuenow",e.currentTime+""),this.setAttribute("aria-valuetext",Math.round(e.currentTime)+" "+e.i18n("core.seconds","Seconds")),t.live||T(e,this.bufferEle))}),e.on("loadedmetadata",()=>{0!=e.reaper&&(t.live||T(e,this.bufferEle))}),e.on(o,t=>{if(0==e.reaper)return;const n=function(e){return e.opt("live",!1)||e.duration>=Number.MAX_SAFE_INTEGER}(e),r=n?function(e){return isFinite(e.duration)?e.duration:0==e.seekable.length?0:B(e).head}(e):t.data||e.duration;isNaN(r)||(this.setAttribute("aria-valuemax",r+""),this.setAttribute("aria-valuemin","0"))}),this.addEventListener("mouseleave",()=>{e.emit("timeline/gesture/end"),t.live?S(this.proposedSeekBar,this.tooltipEle):N(this.proposedSeekBar,this.tooltipEle)})}}class FlowplayerChaptersTimelineBar extends FlowplayerTimelineBar{constructor(e){super(e),this.handleChapters(e)}handleChapters(e){const t=document.createElement("div");let n;this.addEventListener(l,e=>{t.innerText="",this.querySelectorAll(".fp-chapter").forEach(e=>this.removeChild(e)),e.data&&e.data.forEach(e=>{const r=document.createElement("div");r.className="fp-chapter",r.style.left=e.left,r.style.bottom=r.style.top="0",r.style.width=e.width,r.title=e.title,r.onmouseover=()=>{t.innerText=e.title},r.onmouseleave=()=>{t.innerText=n||""},this.appendChild(r)})}),this.addEventListener(c,r=>{var i;const s=r.data;s&&(t.parentNode||(null===(i=h(e,"flowplayer-control"))||void 0===i||i.insertAdjacentElement("beforebegin",t),t.classList.toggle("fp-togglable",!0),t.classList.toggle("fp-chapter-info",!0)),n=s,t.innerText=s)})}}var x;const I=((x=class Chapters{constructor(t){this._track_added_handler=e,this._cue_changed_handler=e,this.chapters=[],this.render=this.render.bind(this),_(t,f,"flowplayer-chapters-timeline-bar",FlowplayerChaptersTimelineBar)}init(e,t,n){this._root=t,this._player=n,this._timeline=h(n,f),this._track_added_handler=this.track_added.bind(this,n),this._cue_changed_handler=this.cue_changed.bind(this,n),n.textTracks.addEventListener("addtrack",this._track_added_handler),this.wireup(n,e),n.chapters=this,n.on(a,e=>{e.data&&this.wireup(n,e.data)}),n.on(["playlist/advance","src"],e=>{n.currentSrc&&("src"===e.type&&["is-playlist",m].some(e=>n.root.classList.contains(e))||(this._current_chapters_src=void 0,delete n.opts.chapters,this.wiredown(n)))}),n.on("reap",()=>{this.wiredown(n),n.textTracks.removeEventListener("addtrack",this._track_added_handler),n.off(o,this.render)}),n.on(o,this.render)}track_added(e,t){}cue_changed(e,t){var n;this._current_chapters_track&&(this.current_cue=this._current_chapters_track.track.activeCues?this._current_chapters_track.track.activeCues[0]:void 0,this._timeline&&d(this._timeline,c,null===(n=this.current_cue)||void 0===n?void 0:n.text))}set_chapters(e){this.chapters=e,this.render()}jump(e){this._player&&this.chapters[e]&&(this._player.currentTime=this.chapters[e].start)}current(){if(this.current_cue)return this.chapters.find(e=>e.cue==this.current_cue)}render(){if(!this._root||!this._player||!this._timeline)return;const e=this._player.duration;isFinite(e)&&(d(this._timeline,l,this.chapters.map(t=>({title:t.label,left:t.start/e*100+"%",width:(t.end-t.start)/e*100+"%"}))),this._root.classList.toggle("has-chapters",!!this.chapters.length))}wireup(e,t){const n=Array.isArray(t.chapters)?t.chapters[0]:t.chapters;n&&n.src!==this._current_chapters_src&&(this._current_chapters_track=i(e,Object.assign(Object.assign({},n),{kind:"chapters",default:!0})),this._current_chapters_track.onload=()=>{var e;(null===(e=this._current_chapters_track)||void 0===e?void 0:e.track.cues)&&this.set_chapters(Array.from(this._current_chapters_track.track.cues).filter(e=>e instanceof VTTCue).map(e=>{const t=e;return{start:e.startTime,end:e.endTime,cue:t,label:t.text}}))},this._current_chapters_src=n.src,this._current_chapters_track.addEventListener("cuechange",this._cue_changed_handler))}wiredown(e){this.set_chapters([]),this._current_chapters_track&&(this._current_chapters_track.removeEventListener("cuechange",this._cue_changed_handler),e.removeChild(this._current_chapters_track),this._current_chapters_track=void 0)}}).events=u,x.pluginName="chapters",x);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)});