@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
|
@@ -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 */
|
|
@@ -275,41 +273,6 @@ declare const DESTROYED = "is-destroyed";
|
|
|
275
273
|
|
|
276
274
|
declare const DISABLED = "is-disabled";
|
|
277
275
|
|
|
278
|
-
/**
|
|
279
|
-
* @public
|
|
280
|
-
*/
|
|
281
|
-
declare type DRM_KEYSYSTEM = "com.widevine.alpha" | "com.microsoft.playready" | "org.w3.clearkey" | "com.apple.fps.1_0";
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* @public
|
|
285
|
-
*/
|
|
286
|
-
declare type DRMConfiguration = {
|
|
287
|
-
license_server: string;
|
|
288
|
-
http_headers?: Record<string, string>;
|
|
289
|
-
certificate?: string;
|
|
290
|
-
vendor?: string | DRMVendorImplementation;
|
|
291
|
-
request_media_key_system_access_function?: MediaKeyFunc;
|
|
292
|
-
query_params?: Record<string, string>;
|
|
293
|
-
};
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* @public
|
|
297
|
-
*/
|
|
298
|
-
declare type DRMSourceConfiguration = {
|
|
299
|
-
[keysystem in DRM_KEYSYSTEM]?: DRMConfiguration;
|
|
300
|
-
};
|
|
301
|
-
|
|
302
|
-
/**
|
|
303
|
-
* @public
|
|
304
|
-
*/
|
|
305
|
-
declare type DRMVendorImplementation = {
|
|
306
|
-
fairplay_fetch_certificate: (url: string, cb: (certificate_data: Uint8Array) => void) => void;
|
|
307
|
-
fairplay_request_license: (url: string, params: {
|
|
308
|
-
message: any;
|
|
309
|
-
assetId: string;
|
|
310
|
-
}, cb: (license_data: Uint8Array) => void) => void;
|
|
311
|
-
};
|
|
312
|
-
|
|
313
276
|
/**
|
|
314
277
|
* @public
|
|
315
278
|
*/
|
|
@@ -536,13 +499,13 @@ declare interface FlowplayerUMDWithPlugins<ConfigWithPlugins extends Config = Co
|
|
|
536
499
|
* @param selector - query selector of the HTML element where player will render
|
|
537
500
|
* @param config - Configuration of the flowplayer and the attached plugins
|
|
538
501
|
*/
|
|
539
|
-
(selector: string, config?: ConfigWithPlugins):
|
|
502
|
+
(selector: string, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
|
|
540
503
|
/**
|
|
541
504
|
* Configure flowplayer, it's attached plugins and display flowplayer it in the UI
|
|
542
505
|
* @param element - HTML element where player will render
|
|
543
506
|
* @param config - Configuration of the flowplayer and the attached plugins
|
|
544
507
|
*/
|
|
545
|
-
(element: HTMLElement, config?: ConfigWithPlugins):
|
|
508
|
+
(element: HTMLElement, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
|
|
546
509
|
}
|
|
547
510
|
|
|
548
511
|
/**
|
|
@@ -1166,6 +1129,11 @@ declare type PlayerState = FlowplayerStates[keyof FlowplayerStates];
|
|
|
1166
1129
|
*/
|
|
1167
1130
|
declare type PlayerWith<T> = T & Player;
|
|
1168
1131
|
|
|
1132
|
+
declare type PlayerWithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = Omit<PluginPlayer, "opts" | "setOpts"> & {
|
|
1133
|
+
opts: PluginConfig;
|
|
1134
|
+
setOpts: (config: PluginConfig) => void;
|
|
1135
|
+
};
|
|
1136
|
+
|
|
1169
1137
|
declare const PLAYING = "is-playing";
|
|
1170
1138
|
|
|
1171
1139
|
/**
|
|
@@ -1196,6 +1164,7 @@ declare interface Plugin_2<PluginConfig extends Config = Config, PluginPlayer ex
|
|
|
1196
1164
|
*/
|
|
1197
1165
|
declare interface PluginCtor<PluginConfig extends Config = Config, PluginPlayer extends Player = Player> {
|
|
1198
1166
|
new (umd: FlowplayerUMD, player: Player): Plugin_2<PluginConfig, PluginPlayer>;
|
|
1167
|
+
pluginName: string;
|
|
1199
1168
|
}
|
|
1200
1169
|
|
|
1201
1170
|
/* Excluded from this release type: PluginRegisteredEventDetail */
|
|
@@ -1494,7 +1463,6 @@ declare type SourceObj<T = unknown> = {
|
|
|
1494
1463
|
* the MIME type (example `video/mp4` or `application/x-mpegurl`)
|
|
1495
1464
|
*/
|
|
1496
1465
|
type?: string;
|
|
1497
|
-
drm?: DRMSourceConfiguration;
|
|
1498
1466
|
} & T;
|
|
1499
1467
|
|
|
1500
1468
|
/**
|
|
@@ -1718,6 +1686,4 @@ declare const WILL_PLAY = "will-play";
|
|
|
1718
1686
|
|
|
1719
1687
|
declare const WILL_SEEK = "will-seek";
|
|
1720
1688
|
|
|
1721
|
-
declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = SetFieldType<SetFieldType<PluginPlayer, "opts", PluginConfig>, "setOpts", (config: PluginConfig) => void>;
|
|
1722
|
-
|
|
1723
1689
|
export { }
|
package/plugins/context-menu.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.context_menu=t())}(this,(function(){"use strict";const e=document.createElement;function t(t,n){const o=n.href?function(t){const n=e("a");return n.href=t,n}(n.href):e("span"),
|
|
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.context_menu=t())}(this,(function(){"use strict";const e=document.createElement;function t(t,n){const o=n.href?function(t){const n=e("a");return n.href=t,n}(n.href):e("span"),c=n.onclick;return n.class&&(o.className=n.class),n.text&&(o.innerText=n.text),c&&o.addEventListener("click",(function(e){c(e,t)})),o}var n;const o=[{text:"Flowplayer © "+(new Date).getFullYear()},{href:"https://flowplayer.com",text:"About this player"},{href:"https://flowplayer.com/license/",text:"GPL based license"}];let c=!1;const s=e=>{e.classList.remove("fp-active"),c=!1};document.addEventListener("click",e=>{2!=e.button&&0!=c&&s(c)}),document.addEventListener("keyup",(function(){c&&s(c)}));const i=((n=class ContextMenu{init(e,n,s){const i=e.context_menu||o,l=document.createElement("div");l.className="fp-context-menu fp-menu",l.append(...i.map(e=>t(s,e)));const r=function(e,t){const n=e._customElements.get(t);return n&&e.root.querySelector(n)||void 0}(s,"flowplayer-ui");r&&r.addEventListener("contextmenu",(function(e){if(!l.parentNode)return;e.preventDefault(),s.emit("contextmenu");const t=l.getBoundingClientRect();l.style.left=e.clientX-window.scrollX-t.left+2+"px",l.style.right=e.clientY+window.scrollY-t.top-5+"px",l.classList.contains("fp-active")||(l.classList.contains("fp-active"),c=l)}))}}).pluginName="context-menu",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)}));
|
package/plugins/cuepoints.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 */
|
|
@@ -384,41 +382,6 @@ declare const DESTROYED = "is-destroyed";
|
|
|
384
382
|
|
|
385
383
|
declare const DISABLED = "is-disabled";
|
|
386
384
|
|
|
387
|
-
/**
|
|
388
|
-
* @public
|
|
389
|
-
*/
|
|
390
|
-
declare type DRM_KEYSYSTEM = "com.widevine.alpha" | "com.microsoft.playready" | "org.w3.clearkey" | "com.apple.fps.1_0";
|
|
391
|
-
|
|
392
|
-
/**
|
|
393
|
-
* @public
|
|
394
|
-
*/
|
|
395
|
-
declare type DRMConfiguration = {
|
|
396
|
-
license_server: string;
|
|
397
|
-
http_headers?: Record<string, string>;
|
|
398
|
-
certificate?: string;
|
|
399
|
-
vendor?: string | DRMVendorImplementation;
|
|
400
|
-
request_media_key_system_access_function?: MediaKeyFunc;
|
|
401
|
-
query_params?: Record<string, string>;
|
|
402
|
-
};
|
|
403
|
-
|
|
404
|
-
/**
|
|
405
|
-
* @public
|
|
406
|
-
*/
|
|
407
|
-
declare type DRMSourceConfiguration = {
|
|
408
|
-
[keysystem in DRM_KEYSYSTEM]?: DRMConfiguration;
|
|
409
|
-
};
|
|
410
|
-
|
|
411
|
-
/**
|
|
412
|
-
* @public
|
|
413
|
-
*/
|
|
414
|
-
declare type DRMVendorImplementation = {
|
|
415
|
-
fairplay_fetch_certificate: (url: string, cb: (certificate_data: Uint8Array) => void) => void;
|
|
416
|
-
fairplay_request_license: (url: string, params: {
|
|
417
|
-
message: any;
|
|
418
|
-
assetId: string;
|
|
419
|
-
}, cb: (license_data: Uint8Array) => void) => void;
|
|
420
|
-
};
|
|
421
|
-
|
|
422
385
|
/**
|
|
423
386
|
* @public
|
|
424
387
|
*/
|
|
@@ -653,13 +616,13 @@ declare interface FlowplayerUMDWithPlugins<ConfigWithPlugins extends Config = Co
|
|
|
653
616
|
* @param selector - query selector of the HTML element where player will render
|
|
654
617
|
* @param config - Configuration of the flowplayer and the attached plugins
|
|
655
618
|
*/
|
|
656
|
-
(selector: string, config?: ConfigWithPlugins):
|
|
619
|
+
(selector: string, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
|
|
657
620
|
/**
|
|
658
621
|
* Configure flowplayer, it's attached plugins and display flowplayer it in the UI
|
|
659
622
|
* @param element - HTML element where player will render
|
|
660
623
|
* @param config - Configuration of the flowplayer and the attached plugins
|
|
661
624
|
*/
|
|
662
|
-
(element: HTMLElement, config?: ConfigWithPlugins):
|
|
625
|
+
(element: HTMLElement, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
|
|
663
626
|
}
|
|
664
627
|
|
|
665
628
|
/**
|
|
@@ -1276,6 +1239,11 @@ declare type PlayerState = FlowplayerStates[keyof FlowplayerStates];
|
|
|
1276
1239
|
*/
|
|
1277
1240
|
declare type PlayerWith<T> = T & Player;
|
|
1278
1241
|
|
|
1242
|
+
declare type PlayerWithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = Omit<PluginPlayer, "opts" | "setOpts"> & {
|
|
1243
|
+
opts: PluginConfig;
|
|
1244
|
+
setOpts: (config: PluginConfig) => void;
|
|
1245
|
+
};
|
|
1246
|
+
|
|
1279
1247
|
declare const PLAYING = "is-playing";
|
|
1280
1248
|
|
|
1281
1249
|
/**
|
|
@@ -1306,6 +1274,7 @@ declare interface Plugin_2<PluginConfig extends Config = Config, PluginPlayer ex
|
|
|
1306
1274
|
*/
|
|
1307
1275
|
declare interface PluginCtor<PluginConfig extends Config = Config, PluginPlayer extends Player = Player> {
|
|
1308
1276
|
new (umd: FlowplayerUMD, player: Player): Plugin_2<PluginConfig, PluginPlayer>;
|
|
1277
|
+
pluginName: string;
|
|
1309
1278
|
}
|
|
1310
1279
|
|
|
1311
1280
|
/* Excluded from this release type: PluginRegisteredEventDetail */
|
|
@@ -1604,7 +1573,6 @@ declare type SourceObj<T = unknown> = {
|
|
|
1604
1573
|
* the MIME type (example `video/mp4` or `application/x-mpegurl`)
|
|
1605
1574
|
*/
|
|
1606
1575
|
type?: string;
|
|
1607
|
-
drm?: DRMSourceConfiguration;
|
|
1608
1576
|
} & T;
|
|
1609
1577
|
|
|
1610
1578
|
/**
|
|
@@ -1828,6 +1796,4 @@ declare const WILL_PLAY = "will-play";
|
|
|
1828
1796
|
|
|
1829
1797
|
declare const WILL_SEEK = "will-seek";
|
|
1830
1798
|
|
|
1831
|
-
declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = SetFieldType<SetFieldType<PluginPlayer, "opts", PluginConfig>, "setOpts", (config: PluginConfig) => void>;
|
|
1832
|
-
|
|
1833
1799
|
export { }
|
package/plugins/cuepoints.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.cuepoints=t())}(this,(function(){"use strict";var e=Object.freeze({__proto__:null,CUEPOINTS:"cuepoints",CUEPOINT_START:"cuepointstart",CUEPOINT_END:"cuepointend"});const t=(e,t)=>new(((e,t)=>{const n=e.get(t);if(!n)throw new Error(`no flowplayer component with the name ${t} exists`);const o=window.customElements.get(t);if(!o)throw new Error(`no default flowplayer component with the name ${t} exists`);const r=window.customElements.get(n);return"function"!=typeof r?o:r})(e._customElements,t))(e);function n(e,t,n){const o=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(o),e}function o(e){const t=e._customElements.get("flowplayer-cue");t&&Array.from(e.root.querySelectorAll(t)).forEach(e=>{e.remove()})}function r(e,o){var r;const i=function(e,t){const n=e._customElements.get(t);return n&&e.root.querySelector(n)||void 0}(e,"flowplayer-timeline-bar"),s=e.duration,c=null===(r=null==e?void 0:e.opts)||void 0===r?void 0:r.draw_cuepoints;i&&!e.hasState("is-live")&&isFinite(s)&&Array.isArray(o)&&c&&o.forEach(o=>{if(void 0===o.startTime||o.startTime<0||!o.endTime||o.startTime===o.endTime)return;const r=Math.round(o.startTime/s*1e3)/10;if(r>100||r<0)return;const c=o.endTime-o.startTime,u=t(e,"flowplayer-cue");n(u,"cue:attributes",{left:r+"%",width:c/s*100+"%"}),i.append(u)})}!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){}}();class FlowplayerComponent extends HTMLElement{constructor(e){super(),this.player=e}}class CueComponent extends FlowplayerComponent{constructor(e){super(e),this.className="fp-cuepoint",this.addEventListener("cue:attributes",e=>{this.style.setProperty("left",e.detail.left),this.style.setProperty("width",e.detail.width)})}}var i;const s=((i=class Cuepoints{constructor(e){((e,t,n)=>{window.customElements.get(t)||window.customElements.define(t,n),e.customElements.get(t)||e.customElements.set(t,t)})(e,"flowplayer-cue",CueComponent)}init(e,t,n){if(!n.reaper)return;const s=n.addTextTrack("metadata","fp-cuepoints");s.removeCue=function(e){this===i&&TextTrack.prototype.removeCue.call(s,e)},n.reaper.set("cuepoints",[]),n.on("config",(function(t){var o;if(!n.reaper)return;(null===(o=t.data)||void 0===o?void 0:o.cuepoints)!==n.reaper.get("cuepoints")&&n.emit("cuepoints",{cuepoints:e.cuepoints})})),n.on("durationchange",()=>{n.reaper&&(o(n),r(n,n.reaper.get("cuepoints")))}),n.on("cuepoints",e=>{var t;if(!n.reaper)return;const i=(null===(t=e.data)||void 0===t?void 0:t.cuepoints)||[];n.reaper.set("cuepoints",i),Array.from(s.cues||{length:0}).forEach(e=>s.removeCue.call(this.constructor,e)),o(n),i.map((function(e){return function(e,t){try{const n=new VTTCue(t.startTime,t.endTime,t.text||"");return n.id=t.id||"",n.onenter=e.emit.bind(e,"cuepointstart",{cuepoint:t}),n.onexit=e.emit.bind(e,"cuepointend",{cuepoint:t}),n}catch(e){if(t.startTime===t.endTime)return console.warn("Cue(:error)> startTime cannot equal endTime on this platform");throw e}}(n,e)})).forEach((function(e){e&&s.addCue(e)})),r(n,i)})}}).events=e,i);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,s)}));
|
|
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.cuepoints=t())}(this,(function(){"use strict";var e=Object.freeze({__proto__:null,CUEPOINTS:"cuepoints",CUEPOINT_START:"cuepointstart",CUEPOINT_END:"cuepointend"});const t=(e,t)=>new(((e,t)=>{const n=e.get(t);if(!n)throw new Error(`no flowplayer component with the name ${t} exists`);const o=window.customElements.get(t);if(!o)throw new Error(`no default flowplayer component with the name ${t} exists`);const r=window.customElements.get(n);return"function"!=typeof r?o:r})(e._customElements,t))(e);function n(e,t,n){const o=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(o),e}function o(e){const t=e._customElements.get("flowplayer-cue");t&&Array.from(e.root.querySelectorAll(t)).forEach(e=>{e.remove()})}function r(e,o){var r;const i=function(e,t){const n=e._customElements.get(t);return n&&e.root.querySelector(n)||void 0}(e,"flowplayer-timeline-bar"),s=e.duration,c=null===(r=null==e?void 0:e.opts)||void 0===r?void 0:r.draw_cuepoints;i&&!e.hasState("is-live")&&isFinite(s)&&Array.isArray(o)&&c&&o.forEach(o=>{if(void 0===o.startTime||o.startTime<0||!o.endTime||o.startTime===o.endTime)return;const r=Math.round(o.startTime/s*1e3)/10;if(r>100||r<0)return;const c=o.endTime-o.startTime,u=t(e,"flowplayer-cue");n(u,"cue:attributes",{left:r+"%",width:c/s*100+"%"}),i.append(u)})}!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){}}();class FlowplayerComponent extends HTMLElement{constructor(e){super(),this.player=e}}class CueComponent extends FlowplayerComponent{constructor(e){super(e),this.className="fp-cuepoint",this.addEventListener("cue:attributes",e=>{this.style.setProperty("left",e.detail.left),this.style.setProperty("width",e.detail.width)})}}var i;const s=((i=class Cuepoints{constructor(e){((e,t,n)=>{window.customElements.get(t)||window.customElements.define(t,n),e.customElements.get(t)||e.customElements.set(t,t)})(e,"flowplayer-cue",CueComponent)}init(e,t,n){if(!n.reaper)return;const s=n.addTextTrack("metadata","fp-cuepoints");s.removeCue=function(e){this===i&&TextTrack.prototype.removeCue.call(s,e)},n.reaper.set("cuepoints",[]),n.on("config",(function(t){var o;if(!n.reaper)return;(null===(o=t.data)||void 0===o?void 0:o.cuepoints)!==n.reaper.get("cuepoints")&&n.emit("cuepoints",{cuepoints:e.cuepoints})})),n.on("durationchange",()=>{n.reaper&&(o(n),r(n,n.reaper.get("cuepoints")))}),n.on("cuepoints",e=>{var t;if(!n.reaper)return;const i=(null===(t=e.data)||void 0===t?void 0:t.cuepoints)||[];n.reaper.set("cuepoints",i),Array.from(s.cues||{length:0}).forEach(e=>s.removeCue.call(this.constructor,e)),o(n),i.map((function(e){return function(e,t){try{const n=new VTTCue(t.startTime,t.endTime,t.text||"");return n.id=t.id||"",n.onenter=e.emit.bind(e,"cuepointstart",{cuepoint:t}),n.onexit=e.emit.bind(e,"cuepointend",{cuepoint:t}),n}catch(e){if(t.startTime===t.endTime)return console.warn("Cue(:error)> startTime cannot equal endTime on this platform");throw e}}(n,e)})).forEach((function(e){e&&s.addCue(e)})),r(n,i)})}}).pluginName="cuepoints",i.events=e,i);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,s)}));
|
package/plugins/dash.d.ts
CHANGED
|
@@ -4,11 +4,9 @@ import type { BitrateInfo } from 'dashjs';
|
|
|
4
4
|
import type * as DashJS from 'dashjs';
|
|
5
5
|
import type { Get } from 'type-fest';
|
|
6
6
|
import type { Level } from 'hls.js';
|
|
7
|
-
import type { MediaKeyFunc } from 'hls.js';
|
|
8
7
|
import type { MediaPlayerClass } from 'dashjs';
|
|
9
8
|
import type { MediaSettings } from 'dashjs';
|
|
10
9
|
import type { ProtectionDataSet } from 'dashjs';
|
|
11
|
-
import type { SetFieldType } from 'type-fest';
|
|
12
10
|
import type { TupleToUnion } from 'type-fest';
|
|
13
11
|
|
|
14
12
|
declare namespace allEvents {
|
|
@@ -329,41 +327,6 @@ declare const DESTROYED = "is-destroyed";
|
|
|
329
327
|
|
|
330
328
|
declare const DISABLED = "is-disabled";
|
|
331
329
|
|
|
332
|
-
/**
|
|
333
|
-
* @public
|
|
334
|
-
*/
|
|
335
|
-
declare type DRM_KEYSYSTEM = "com.widevine.alpha" | "com.microsoft.playready" | "org.w3.clearkey" | "com.apple.fps.1_0";
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* @public
|
|
339
|
-
*/
|
|
340
|
-
declare type DRMConfiguration = {
|
|
341
|
-
license_server: string;
|
|
342
|
-
http_headers?: Record<string, string>;
|
|
343
|
-
certificate?: string;
|
|
344
|
-
vendor?: string | DRMVendorImplementation;
|
|
345
|
-
request_media_key_system_access_function?: MediaKeyFunc;
|
|
346
|
-
query_params?: Record<string, string>;
|
|
347
|
-
};
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* @public
|
|
351
|
-
*/
|
|
352
|
-
declare type DRMSourceConfiguration = {
|
|
353
|
-
[keysystem in DRM_KEYSYSTEM]?: DRMConfiguration;
|
|
354
|
-
};
|
|
355
|
-
|
|
356
|
-
/**
|
|
357
|
-
* @public
|
|
358
|
-
*/
|
|
359
|
-
declare type DRMVendorImplementation = {
|
|
360
|
-
fairplay_fetch_certificate: (url: string, cb: (certificate_data: Uint8Array) => void) => void;
|
|
361
|
-
fairplay_request_license: (url: string, params: {
|
|
362
|
-
message: any;
|
|
363
|
-
assetId: string;
|
|
364
|
-
}, cb: (license_data: Uint8Array) => void) => void;
|
|
365
|
-
};
|
|
366
|
-
|
|
367
330
|
/**
|
|
368
331
|
* @public
|
|
369
332
|
*/
|
|
@@ -590,13 +553,13 @@ declare interface FlowplayerUMDWithPlugins<ConfigWithPlugins extends Config = Co
|
|
|
590
553
|
* @param selector - query selector of the HTML element where player will render
|
|
591
554
|
* @param config - Configuration of the flowplayer and the attached plugins
|
|
592
555
|
*/
|
|
593
|
-
(selector: string, config?: ConfigWithPlugins):
|
|
556
|
+
(selector: string, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
|
|
594
557
|
/**
|
|
595
558
|
* Configure flowplayer, it's attached plugins and display flowplayer it in the UI
|
|
596
559
|
* @param element - HTML element where player will render
|
|
597
560
|
* @param config - Configuration of the flowplayer and the attached plugins
|
|
598
561
|
*/
|
|
599
|
-
(element: HTMLElement, config?: ConfigWithPlugins):
|
|
562
|
+
(element: HTMLElement, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
|
|
600
563
|
}
|
|
601
564
|
|
|
602
565
|
/**
|
|
@@ -1213,6 +1176,11 @@ declare type PlayerState = FlowplayerStates[keyof FlowplayerStates];
|
|
|
1213
1176
|
*/
|
|
1214
1177
|
declare type PlayerWith<T> = T & Player;
|
|
1215
1178
|
|
|
1179
|
+
declare type PlayerWithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = Omit<PluginPlayer, "opts" | "setOpts"> & {
|
|
1180
|
+
opts: PluginConfig;
|
|
1181
|
+
setOpts: (config: PluginConfig) => void;
|
|
1182
|
+
};
|
|
1183
|
+
|
|
1216
1184
|
declare const PLAYING = "is-playing";
|
|
1217
1185
|
|
|
1218
1186
|
/**
|
|
@@ -1243,6 +1211,7 @@ declare interface Plugin_2<PluginConfig extends Config = Config, PluginPlayer ex
|
|
|
1243
1211
|
*/
|
|
1244
1212
|
declare interface PluginCtor<PluginConfig extends Config = Config, PluginPlayer extends Player = Player> {
|
|
1245
1213
|
new (umd: FlowplayerUMD, player: Player): Plugin_2<PluginConfig, PluginPlayer>;
|
|
1214
|
+
pluginName: string;
|
|
1246
1215
|
}
|
|
1247
1216
|
|
|
1248
1217
|
/* Excluded from this release type: PluginRegisteredEventDetail */
|
|
@@ -1541,7 +1510,6 @@ declare type SourceObj<T = unknown> = {
|
|
|
1541
1510
|
* the MIME type (example `video/mp4` or `application/x-mpegurl`)
|
|
1542
1511
|
*/
|
|
1543
1512
|
type?: string;
|
|
1544
|
-
drm?: DRMSourceConfiguration;
|
|
1545
1513
|
} & T;
|
|
1546
1514
|
|
|
1547
1515
|
/**
|
|
@@ -1765,6 +1733,4 @@ declare const WILL_PLAY = "will-play";
|
|
|
1765
1733
|
|
|
1766
1734
|
declare const WILL_SEEK = "will-seek";
|
|
1767
1735
|
|
|
1768
|
-
declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = SetFieldType<SetFieldType<PluginPlayer, "opts", PluginConfig>, "setOpts", (config: PluginConfig) => void>;
|
|
1769
|
-
|
|
1770
1736
|
export { }
|