@flowplayer/player 3.23.1-rc → 3.24.0-rc.2
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.
- package/core/events.js +148 -74
- package/core.js +1 -1
- package/default.js +1 -1
- package/embed.js +2 -2
- package/index.d.ts +8 -37
- package/package.json +1 -1
- package/plugins/ads.d.ts +13 -42
- package/plugins/ads.js +2 -2
- package/plugins/airplay.d.ts +8 -42
- package/plugins/airplay.js +1 -1
- package/plugins/analytics.d.ts +8 -42
- package/plugins/analytics.js +1 -1
- package/plugins/asel.d.ts +8 -42
- package/plugins/asel.js +1 -1
- package/plugins/audio.d.ts +8 -42
- package/plugins/audio.js +1 -1
- package/plugins/chapters.d.ts +8 -42
- package/plugins/chapters.js +1 -1
- package/plugins/chromecast.d.ts +8 -42
- package/plugins/chromecast.js +1 -1
- package/plugins/comscore.d.ts +8 -42
- package/plugins/comscore.js +1 -1
- package/plugins/consent.d.ts +8 -42
- package/plugins/consent.js +1 -1
- package/plugins/context-menu.d.ts +8 -42
- package/plugins/context-menu.js +1 -1
- package/plugins/cuepoints.d.ts +8 -42
- package/plugins/cuepoints.js +1 -1
- package/plugins/dash.d.ts +8 -42
- package/plugins/dash.js +1 -1
- package/plugins/drm.d.ts +70 -8
- package/plugins/drm.js +1 -1
- package/plugins/endscreen.d.ts +8 -42
- package/plugins/endscreen.js +1 -1
- package/plugins/fas.d.ts +8 -42
- package/plugins/fas.js +1 -1
- package/plugins/float-on-scroll.d.ts +8 -42
- package/plugins/float-on-scroll.js +1 -1
- package/plugins/ga4.d.ts +8 -42
- package/plugins/ga4.js +1 -1
- package/plugins/gemius.d.ts +8 -42
- package/plugins/gemius.js +1 -1
- package/plugins/google-analytics.d.ts +8 -42
- package/plugins/google-analytics.js +1 -1
- package/plugins/hls.d.ts +8 -42
- package/plugins/hls.js +1 -1
- package/plugins/id3.d.ts +8 -42
- package/plugins/id3.js +1 -1
- package/plugins/iframe.d.ts +8 -42
- package/plugins/iframe.js +1 -1
- package/plugins/keyboard.d.ts +8 -42
- package/plugins/keyboard.js +1 -1
- package/plugins/media-session.d.ts +8 -42
- package/plugins/media-session.js +1 -1
- package/plugins/message.d.ts +8 -42
- package/plugins/message.js +1 -1
- package/plugins/ovp.d.ts +8 -42
- package/plugins/ovp.js +1 -1
- package/plugins/playlist.d.ts +95 -43
- package/plugins/playlist.js +1 -1
- package/plugins/preview.d.ts +8 -42
- package/plugins/preview.js +1 -1
- package/plugins/qsel.d.ts +8 -42
- package/plugins/qsel.js +1 -1
- package/plugins/qul.d.ts +8 -42
- package/plugins/qul.js +1 -1
- package/plugins/rts.d.ts +8 -42
- package/plugins/rts.js +1 -1
- package/plugins/share.d.ts +8 -42
- package/plugins/share.js +1 -1
- package/plugins/speed.d.ts +8 -42
- package/plugins/speed.js +1 -1
- package/plugins/ssai.d.ts +8 -42
- package/plugins/ssai.js +1 -1
- package/plugins/subtitles.d.ts +15 -45
- package/plugins/subtitles.js +1 -1
- package/plugins/thumbnails.d.ts +8 -42
- package/plugins/thumbnails.js +1 -1
- package/plugins/tizen.d.ts +8 -42
- package/plugins/tizen.js +1 -1
- package/plugins/vtsel.d.ts +8 -42
- package/plugins/vtsel.js +1 -1
- package/plugins/webos.d.ts +8 -42
- package/plugins/webos.js +1 -1
- package/util/loader.d.ts +8 -42
- package/util/loader.js +9 -8
package/plugins/webos.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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.webos=t())}(this,(function(){"use strict";const e="is-hovered",t=(e,t)=>new(((e,t)=>{const s=e.get(t);if(!s)throw new Error(`no flowplayer component with the name ${t} exists`);const n=window.customElements.get(t);if(!n)throw new Error(`no default flowplayer component with the name ${t} exists`);const i=window.customElements.get(s);return"function"!=typeof i?n:i})(e._customElements,t))(e);class FlowplayerComponent extends HTMLElement{constructor(e){super(),this.player=e}}class TvMenu extends FlowplayerComponent{constructor(e){super(e),this.classList.add("tv-menu"),e.on("src",()=>this.classList.remove("is-open"))}open(){var e;this.player.emit("tv-menu:will-open"),this.classList.add("is-open"),null===(e=this.getMenus()[0].querySelector("li"))||void 0===e||e.focus()}close(){const e=new CustomEvent("tv-menu:will-close",{cancelable:!0});this.player.dispatchEvent(e),e.defaultPrevented||this.classList.remove("is-open")}append(e){super.append(e.menu)}is_empty(){return!this.getMenus().length}find_focusable_menu(e,t){const s=this.getMenus();return(t?s:s.slice(0).reverse()).find((t,s,n)=>s>n.indexOf(e))}getMenus(){return Array.from(this.children).filter(e=>"none"!==e.style.display)}}const s="is-tv-seeking";let n=void 0;function i(e,t){e.enqueueSeek(t)&&function(e){e.setState("is-kb-active",!0),clearTimeout(n),n=setTimeout((function(){e.setState("is-kb-active",!1)}),2500)}(e)}var o,r={EXIT:461,ENTER:13,PLAY:415,PAUSE:19,REWIND:412,FORWARD:417,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40};const a=((o=class Webos extends class TvPlugin{constructor(e){this.umd=e,this.should_restart=!1,this.previous_current_time=0,((e,t,s)=>{window.customElements.get(t)||window.customElements.define(t,s),e.customElements.get(t)||e.customElements.set(t,t)})(e,"flowplayer-tv-menu",TvMenu)}init(e,s,n){n.setState("is-tv",!0),this.menu=t(n,"flowplayer-tv-menu"),s.append(this.menu)}keydown_listener(e,t,s,n,i){const o=this.is_linearAd_on(s);return o||e!==t.ARROW_UP||n.classList.contains("is-open")||n.is_empty()?!o&&n.classList.contains("is-open")?this.menu_handler(e,t,n):void this.main_handler(e,t,s,o,i):n.open()}menu_handler(e,t,s){var n,i,o;if([t.BACK,t.BACK1,t.EXIT].includes(e))return s.close();if([t.ARROW_UP,t.ARROW_DOWN,t.ARROW_RIGHT,t.ARROW_LEFT,t.ENTER].includes(e)){const r=document.activeElement,a=null===(n=document.activeElement)||void 0===n?void 0:n.closest(".fp-menu");if(!r||!a)return;if(e===t.ENTER)return r.dispatchEvent(new Event("click"));if(e===t.ARROW_DOWN&&r.nextSibling)return r.nextSibling.focus();if(e===t.ARROW_UP&&r.previousSibling)return r.previousSibling.focus();if([t.ARROW_RIGHT,t.ARROW_LEFT].includes(e))return null===(o=null===(i=s.find_focusable_menu(a,e===t.ARROW_RIGHT))||void 0===i?void 0:i.querySelector("li"))||void 0===o?void 0:o.focus()}}main_handler(e,t,s,n,i){switch(e){case t.ENTER:return this.on_enter(s,n);case t.PLAY:return this.on_play(s,n);case t.PAUSE:return s.togglePlay(!1);case t.FORWARD:case t.ARROW_RIGHT:return this.on_seek(s,i||10,n);case t.REWIND:case t.ARROW_LEFT:return this.on_seek(s,-(i||10),n);case t.BACK:case t.BACK2:case t.BACK1:case t.EXIT:return this.on_exit(s,n);case t.ARROW_DOWN:return this.on_arrow_down(s,n)}}on_play(t,n){return n?t.togglePlay(!0):(this.is_live_status_focused()&&!t.hasState(e)&&this.live_status_toggle_focus(t,!1),t.hasState(s)?void this.on_seek_end(t,!1):t.togglePlay(!0))}on_enter(e,t){var n;return t?e.togglePlay():this.is_live_status_focused()?(null===(n=e.root.querySelector(".fp-live-status"))||void 0===n||n.dispatchEvent(new Event("click")),this.live_status_toggle_focus(e,!1)):e.hasState(s)?this.on_seek_end(e,!1):e.togglePlay()}on_exit(t,n){return n?t.emit("fullscreen:exit"):this.is_live_status_focused()?this.live_status_toggle_focus(t,!1):t.hasState(s)?this.on_seek_end(t,!0):t.hasState(e)?t.setState(e,!1):t.emit("fullscreen:exit")}on_arrow_down(t,s){if(clearTimeout(this.hover_timeout),this.hover_timeout=setTimeout(()=>{t.setState(e,!1),this.live_status_toggle_focus(t,!1)},2e3),!t.hasState(e)&&!t.hasState("is-paused"))return t.setState(e,!0);s||!t.hasState("is-live")||t.hasState("no-timeline")||this.live_status_toggle_focus(t,!0)}on_seek(e,t,n){n||e.hasState("is-live")&&e.hasState("no-timeline")||(e.hasState(s)||(this.should_restart=!e.hasState("is-paused"),this.previous_current_time=e.currentTime),e.paused||e.togglePlay(!1),e.setState(s,!0),i(e,t))}on_seek_end(e,t){e.setState(s,!1),t&&(e.currentTime=this.previous_current_time),t&&!this.should_restart||e.togglePlay(!0)}live_status_toggle_focus(e,t){const s=e.root.querySelector(".fp-live-status");s&&(t?s.focus():s.blur())}is_live_status_focused(){var e;const t=document.activeElement;return null===(e=null==t?void 0:t.classList)||void 0===e?void 0:e.contains("fp-live-status")}is_linearAd_on(e){var t,s;return!(!e.hasState("ad-paused")&&!e.hasState("ad-playing")||!(null===(s=null===(t=null==e?void 0:e.ads)||void 0===t?void 0:t.adapter)||void 0===s?void 0:s._adLinear))}}{init(e,t,s){(function(){const e="undefined"!=typeof document&&"undefined"!=typeof window,t=e?navigator.userAgent:"",s=/iP(hone|od)/i.test(t)&&!/iPad/.test(t)&&!/IEMobile/i.test(t),n=/Android/.test(t)&&!/Firefox/.test(t),i=/^((?!chrome|android).)*safari/i.test(t),o=/chrome|crios/i.test(t)&&!/opr|opera|chromium|edg|ucbrowser|googlebot/i.test(t),r=/firefox|fxios/i.test(t)&&!/seamonkey/i.test(t),a=/edg/i.test(t),u=/opr|opera/i.test(t),l=/SamsungBrowser/.test(t),c=l&&/SMART-TV/.test(t);return{controls:!s,video:function(t){return e&&document.createElement("video").canPlayType(t)},lang:e&&window.navigator.language,android:n,iphone:s,safari:i,edge:a,opera:u,chrome:o,firefox:r,ios:e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,samsung:l,samsung_tv:l&&c,touch:"ontouchstart"in window,tizen:"tizen"in window,webOS:"webos"in window}})().webOS&&(super.init(e,t,s),document.addEventListener("keydown",t=>{setTimeout(()=>{var n;!t.defaultPrevented&&Object.values(r).includes(t.keyCode)&&this.keydown_listener(t.keyCode,r,s,this.menu,null===(n=e.webos)||void 0===n?void 0:n.seek_step)},0)}))}}).events={EXIT_FULLSCREEN:"fullscreen:exit"},o);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 s=e.flowplayer;return"function"==typeof s?(s(t),t):(Array.isArray(s.extensions)||(s.extensions=[]),~s.extensions.indexOf(t)||s.extensions.push(t),t)}(window,a)}));
|
|
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.webos=t())}(this,(function(){"use strict";const e="is-hovered",t=(e,t)=>new(((e,t)=>{const s=e.get(t);if(!s)throw new Error(`no flowplayer component with the name ${t} exists`);const n=window.customElements.get(t);if(!n)throw new Error(`no default flowplayer component with the name ${t} exists`);const i=window.customElements.get(s);return"function"!=typeof i?n:i})(e._customElements,t))(e);class FlowplayerComponent extends HTMLElement{constructor(e){super(),this.player=e}}class TvMenu extends FlowplayerComponent{constructor(e){super(e),this.classList.add("tv-menu"),e.on("src",()=>this.classList.remove("is-open"))}open(){var e;this.player.emit("tv-menu:will-open"),this.classList.add("is-open"),null===(e=this.getMenus()[0].querySelector("li"))||void 0===e||e.focus()}close(){const e=new CustomEvent("tv-menu:will-close",{cancelable:!0});this.player.dispatchEvent(e),e.defaultPrevented||this.classList.remove("is-open")}append(e){super.append(e.menu)}is_empty(){return!this.getMenus().length}find_focusable_menu(e,t){const s=this.getMenus();return(t?s:s.slice(0).reverse()).find((t,s,n)=>s>n.indexOf(e))}getMenus(){return Array.from(this.children).filter(e=>"none"!==e.style.display)}}const s="is-tv-seeking";let n=void 0;function i(e,t){e.enqueueSeek(t)&&function(e){e.setState("is-kb-active",!0),clearTimeout(n),n=setTimeout((function(){e.setState("is-kb-active",!1)}),2500)}(e)}var o,r={EXIT:461,ENTER:13,PLAY:415,PAUSE:19,REWIND:412,FORWARD:417,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40};const a=((o=class Webos extends class TvPlugin{constructor(e){this.umd=e,this.should_restart=!1,this.previous_current_time=0,((e,t,s)=>{window.customElements.get(t)||window.customElements.define(t,s),e.customElements.get(t)||e.customElements.set(t,t)})(e,"flowplayer-tv-menu",TvMenu)}init(e,s,n){n.setState("is-tv",!0),this.menu=t(n,"flowplayer-tv-menu"),s.append(this.menu)}keydown_listener(e,t,s,n,i){const o=this.is_linearAd_on(s);return o||e!==t.ARROW_UP||n.classList.contains("is-open")||n.is_empty()?!o&&n.classList.contains("is-open")?this.menu_handler(e,t,n):void this.main_handler(e,t,s,o,i):n.open()}menu_handler(e,t,s){var n,i,o;if([t.BACK,t.BACK1,t.EXIT].includes(e))return s.close();if([t.ARROW_UP,t.ARROW_DOWN,t.ARROW_RIGHT,t.ARROW_LEFT,t.ENTER].includes(e)){const r=document.activeElement,a=null===(n=document.activeElement)||void 0===n?void 0:n.closest(".fp-menu");if(!r||!a)return;if(e===t.ENTER)return r.dispatchEvent(new Event("click"));if(e===t.ARROW_DOWN&&r.nextSibling)return r.nextSibling.focus();if(e===t.ARROW_UP&&r.previousSibling)return r.previousSibling.focus();if([t.ARROW_RIGHT,t.ARROW_LEFT].includes(e))return null===(o=null===(i=s.find_focusable_menu(a,e===t.ARROW_RIGHT))||void 0===i?void 0:i.querySelector("li"))||void 0===o?void 0:o.focus()}}main_handler(e,t,s,n,i){switch(e){case t.ENTER:return this.on_enter(s,n);case t.PLAY:return this.on_play(s,n);case t.PAUSE:return s.togglePlay(!1);case t.FORWARD:case t.ARROW_RIGHT:return this.on_seek(s,i||10,n);case t.REWIND:case t.ARROW_LEFT:return this.on_seek(s,-(i||10),n);case t.BACK:case t.BACK2:case t.BACK1:case t.EXIT:return this.on_exit(s,n);case t.ARROW_DOWN:return this.on_arrow_down(s,n)}}on_play(t,n){return n?t.togglePlay(!0):(this.is_live_status_focused()&&!t.hasState(e)&&this.live_status_toggle_focus(t,!1),t.hasState(s)?void this.on_seek_end(t,!1):t.togglePlay(!0))}on_enter(e,t){var n;return t?e.togglePlay():this.is_live_status_focused()?(null===(n=e.root.querySelector(".fp-live-status"))||void 0===n||n.dispatchEvent(new Event("click")),this.live_status_toggle_focus(e,!1)):e.hasState(s)?this.on_seek_end(e,!1):e.togglePlay()}on_exit(t,n){return n?t.emit("fullscreen:exit"):this.is_live_status_focused()?this.live_status_toggle_focus(t,!1):t.hasState(s)?this.on_seek_end(t,!0):t.hasState(e)?t.setState(e,!1):t.emit("fullscreen:exit")}on_arrow_down(t,s){if(clearTimeout(this.hover_timeout),this.hover_timeout=setTimeout(()=>{t.setState(e,!1),this.live_status_toggle_focus(t,!1)},2e3),!t.hasState(e)&&!t.hasState("is-paused"))return t.setState(e,!0);s||!t.hasState("is-live")||t.hasState("no-timeline")||this.live_status_toggle_focus(t,!0)}on_seek(e,t,n){n||e.hasState("is-live")&&e.hasState("no-timeline")||(e.hasState(s)||(this.should_restart=!e.hasState("is-paused"),this.previous_current_time=e.currentTime),e.paused||e.togglePlay(!1),e.setState(s,!0),i(e,t))}on_seek_end(e,t){e.setState(s,!1),t&&(e.currentTime=this.previous_current_time),t&&!this.should_restart||e.togglePlay(!0)}live_status_toggle_focus(e,t){const s=e.root.querySelector(".fp-live-status");s&&(t?s.focus():s.blur())}is_live_status_focused(){var e;const t=document.activeElement;return null===(e=null==t?void 0:t.classList)||void 0===e?void 0:e.contains("fp-live-status")}is_linearAd_on(e){var t,s;return!(!e.hasState("ad-paused")&&!e.hasState("ad-playing")||!(null===(s=null===(t=null==e?void 0:e.ads)||void 0===t?void 0:t.adapter)||void 0===s?void 0:s._adLinear))}}{init(e,t,s){(function(){const e="undefined"!=typeof document&&"undefined"!=typeof window,t=e?navigator.userAgent:"",s=/iP(hone|od)/i.test(t)&&!/iPad/.test(t)&&!/IEMobile/i.test(t),n=/Android/.test(t)&&!/Firefox/.test(t),i=/^((?!chrome|android).)*safari/i.test(t),o=/chrome|crios/i.test(t)&&!/opr|opera|chromium|edg|ucbrowser|googlebot/i.test(t),r=/firefox|fxios/i.test(t)&&!/seamonkey/i.test(t),a=/edg/i.test(t),u=/opr|opera/i.test(t),l=/SamsungBrowser/.test(t),c=l&&/SMART-TV/.test(t);return{controls:!s,video:function(t){return e&&document.createElement("video").canPlayType(t)},lang:e&&window.navigator.language,android:n,iphone:s,safari:i,edge:a,opera:u,chrome:o,firefox:r,ios:e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,samsung:l,samsung_tv:l&&c,touch:"ontouchstart"in window,tizen:"tizen"in window,webOS:"webos"in window}})().webOS&&(super.init(e,t,s),document.addEventListener("keydown",t=>{setTimeout(()=>{var n;!t.defaultPrevented&&Object.values(r).includes(t.keyCode)&&this.keydown_listener(t.keyCode,r,s,this.menu,null===(n=e.webos)||void 0===n?void 0:n.seek_step)},0)}))}}).pluginName="webos",o.events={EXIT_FULLSCREEN:"fullscreen:exit"},o);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 s=e.flowplayer;return"function"==typeof s?(s(t),t):(Array.isArray(s.extensions)||(s.extensions=[]),~s.extensions.indexOf(t)||s.extensions.push(t),t)}(window,a)}));
|
package/util/loader.d.ts
CHANGED
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
import type { BitrateInfo } from 'dashjs';
|
|
4
4
|
import type { Get } from 'type-fest';
|
|
5
5
|
import type { Level } from 'hls.js';
|
|
6
|
-
import type { MediaKeyFunc } from 'hls.js';
|
|
7
|
-
import type { SetFieldType } from 'type-fest';
|
|
8
6
|
import type { TupleToUnion } from 'type-fest';
|
|
9
7
|
|
|
10
8
|
/* Excluded from this release type: AnyLoader */
|
|
@@ -270,41 +268,6 @@ declare const DESTROYED = "is-destroyed";
|
|
|
270
268
|
|
|
271
269
|
declare const DISABLED = "is-disabled";
|
|
272
270
|
|
|
273
|
-
/**
|
|
274
|
-
* @public
|
|
275
|
-
*/
|
|
276
|
-
declare type DRM_KEYSYSTEM = "com.widevine.alpha" | "com.microsoft.playready" | "org.w3.clearkey" | "com.apple.fps.1_0";
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* @public
|
|
280
|
-
*/
|
|
281
|
-
declare type DRMConfiguration = {
|
|
282
|
-
license_server: string;
|
|
283
|
-
http_headers?: Record<string, string>;
|
|
284
|
-
certificate?: string;
|
|
285
|
-
vendor?: string | DRMVendorImplementation;
|
|
286
|
-
request_media_key_system_access_function?: MediaKeyFunc;
|
|
287
|
-
query_params?: Record<string, string>;
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* @public
|
|
292
|
-
*/
|
|
293
|
-
declare type DRMSourceConfiguration = {
|
|
294
|
-
[keysystem in DRM_KEYSYSTEM]?: DRMConfiguration;
|
|
295
|
-
};
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* @public
|
|
299
|
-
*/
|
|
300
|
-
declare type DRMVendorImplementation = {
|
|
301
|
-
fairplay_fetch_certificate: (url: string, cb: (certificate_data: Uint8Array) => void) => void;
|
|
302
|
-
fairplay_request_license: (url: string, params: {
|
|
303
|
-
message: any;
|
|
304
|
-
assetId: string;
|
|
305
|
-
}, cb: (license_data: Uint8Array) => void) => void;
|
|
306
|
-
};
|
|
307
|
-
|
|
308
271
|
/**
|
|
309
272
|
* @public
|
|
310
273
|
*/
|
|
@@ -531,13 +494,13 @@ declare interface FlowplayerUMDWithPlugins<ConfigWithPlugins extends Config = Co
|
|
|
531
494
|
* @param selector - query selector of the HTML element where player will render
|
|
532
495
|
* @param config - Configuration of the flowplayer and the attached plugins
|
|
533
496
|
*/
|
|
534
|
-
(selector: string, config?: ConfigWithPlugins):
|
|
497
|
+
(selector: string, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
|
|
535
498
|
/**
|
|
536
499
|
* Configure flowplayer, it's attached plugins and display flowplayer it in the UI
|
|
537
500
|
* @param element - HTML element where player will render
|
|
538
501
|
* @param config - Configuration of the flowplayer and the attached plugins
|
|
539
502
|
*/
|
|
540
|
-
(element: HTMLElement, config?: ConfigWithPlugins):
|
|
503
|
+
(element: HTMLElement, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
|
|
541
504
|
}
|
|
542
505
|
|
|
543
506
|
/**
|
|
@@ -1164,6 +1127,11 @@ declare type PlayerState = FlowplayerStates[keyof FlowplayerStates];
|
|
|
1164
1127
|
*/
|
|
1165
1128
|
declare type PlayerWith<T> = T & Player;
|
|
1166
1129
|
|
|
1130
|
+
declare type PlayerWithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = Omit<PluginPlayer, "opts" | "setOpts"> & {
|
|
1131
|
+
opts: PluginConfig;
|
|
1132
|
+
setOpts: (config: PluginConfig) => void;
|
|
1133
|
+
};
|
|
1134
|
+
|
|
1167
1135
|
declare const PLAYING = "is-playing";
|
|
1168
1136
|
|
|
1169
1137
|
/**
|
|
@@ -1194,6 +1162,7 @@ declare interface Plugin_2<PluginConfig extends Config = Config, PluginPlayer ex
|
|
|
1194
1162
|
*/
|
|
1195
1163
|
declare interface PluginCtor<PluginConfig extends Config = Config, PluginPlayer extends Player = Player> {
|
|
1196
1164
|
new (umd: FlowplayerUMD, player: Player): Plugin_2<PluginConfig, PluginPlayer>;
|
|
1165
|
+
pluginName: string;
|
|
1197
1166
|
}
|
|
1198
1167
|
|
|
1199
1168
|
/* Excluded from this release type: PluginRegisteredEventDetail */
|
|
@@ -1497,7 +1466,6 @@ declare type SourceObj<T = unknown> = {
|
|
|
1497
1466
|
* the MIME type (example `video/mp4` or `application/x-mpegurl`)
|
|
1498
1467
|
*/
|
|
1499
1468
|
type?: string;
|
|
1500
|
-
drm?: DRMSourceConfiguration;
|
|
1501
1469
|
} & T;
|
|
1502
1470
|
|
|
1503
1471
|
/**
|
|
@@ -1721,6 +1689,4 @@ declare const WILL_PLAY = "will-play";
|
|
|
1721
1689
|
|
|
1722
1690
|
declare const WILL_SEEK = "will-seek";
|
|
1723
1691
|
|
|
1724
|
-
declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = SetFieldType<SetFieldType<PluginPlayer, "opts", PluginConfig>, "setOpts", (config: PluginConfig) => void>;
|
|
1725
|
-
|
|
1726
1692
|
export { }
|
package/util/loader.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports,
|
|
4
|
-
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
5
|
/**
|
|
6
6
|
* @public
|
|
7
7
|
* adds support for asynchronous plugin loading
|
|
@@ -18,7 +18,7 @@ plugin // Only expose explicitly stated API with NoInfer
|
|
|
18
18
|
return plugin;
|
|
19
19
|
if (!("flowplayer" in root))
|
|
20
20
|
root.flowplayer = { extensions: [] };
|
|
21
|
-
|
|
21
|
+
const self = root.flowplayer;
|
|
22
22
|
if (typeof self === "function") {
|
|
23
23
|
self(plugin);
|
|
24
24
|
return plugin;
|
|
@@ -29,14 +29,12 @@ plugin // Only expose explicitly stated API with NoInfer
|
|
|
29
29
|
self.extensions.push(plugin);
|
|
30
30
|
return plugin;
|
|
31
31
|
}
|
|
32
|
-
exports.define = define;
|
|
33
32
|
/**
|
|
34
33
|
* @public
|
|
35
34
|
*/
|
|
36
35
|
function isESM() {
|
|
37
36
|
return document.currentScript === null;
|
|
38
37
|
}
|
|
39
|
-
exports.isESM = isESM;
|
|
40
38
|
/**
|
|
41
39
|
* @public
|
|
42
40
|
*/
|
|
@@ -47,16 +45,19 @@ function root() {
|
|
|
47
45
|
return global;
|
|
48
46
|
return {};
|
|
49
47
|
}
|
|
50
|
-
exports.root = root;
|
|
51
48
|
/**
|
|
52
49
|
* @public
|
|
53
50
|
*/
|
|
54
51
|
function modules() {
|
|
55
|
-
|
|
52
|
+
const self = root();
|
|
56
53
|
// naively check for existance of flowplayer umd
|
|
57
|
-
|
|
54
|
+
const mod = self.flowplayer ? self.flowplayer : { extensions: [] };
|
|
58
55
|
if (!Array.isArray(mod.extensions))
|
|
59
56
|
mod.extensions = [];
|
|
60
57
|
return mod;
|
|
61
58
|
}
|
|
59
|
+
|
|
60
|
+
exports.define = define;
|
|
61
|
+
exports.isESM = isESM;
|
|
62
62
|
exports.modules = modules;
|
|
63
|
+
exports.root = root;
|