@flowplayer/player 3.23.0 → 3.24.0-rc.1

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 (50) hide show
  1. package/core/events.js +148 -74
  2. package/core.js +1 -1
  3. package/default.js +1 -1
  4. package/embed.js +2 -2
  5. package/index.d.ts +7 -37
  6. package/package.json +3 -2
  7. package/plugins/ads.d.ts +12 -42
  8. package/plugins/ads.js +2 -2
  9. package/plugins/airplay.d.ts +7 -42
  10. package/plugins/analytics.d.ts +7 -42
  11. package/plugins/analytics.js +1 -1
  12. package/plugins/asel.d.ts +7 -42
  13. package/plugins/audio.d.ts +7 -42
  14. package/plugins/chapters.d.ts +7 -42
  15. package/plugins/chromecast.d.ts +7 -42
  16. package/plugins/comscore.d.ts +7 -42
  17. package/plugins/consent.d.ts +7 -42
  18. package/plugins/context-menu.d.ts +7 -42
  19. package/plugins/cuepoints.d.ts +7 -42
  20. package/plugins/dash.d.ts +7 -42
  21. package/plugins/drm.d.ts +69 -8
  22. package/plugins/endscreen.d.ts +7 -42
  23. package/plugins/fas.d.ts +7 -42
  24. package/plugins/float-on-scroll.d.ts +7 -42
  25. package/plugins/ga4.d.ts +7 -42
  26. package/plugins/gemius.d.ts +7 -42
  27. package/plugins/google-analytics.d.ts +7 -42
  28. package/plugins/hls.d.ts +7 -42
  29. package/plugins/id3.d.ts +7 -42
  30. package/plugins/iframe.d.ts +7 -42
  31. package/plugins/keyboard.d.ts +7 -42
  32. package/plugins/media-session.d.ts +7 -42
  33. package/plugins/message.d.ts +7 -42
  34. package/plugins/ovp.d.ts +7 -42
  35. package/plugins/playlist.d.ts +94 -43
  36. package/plugins/preview.d.ts +7 -42
  37. package/plugins/qsel.d.ts +7 -42
  38. package/plugins/qul.d.ts +7 -42
  39. package/plugins/rts.d.ts +7 -42
  40. package/plugins/share.d.ts +7 -42
  41. package/plugins/speed.d.ts +7 -42
  42. package/plugins/ssai.d.ts +7 -42
  43. package/plugins/ssai.js +1 -1
  44. package/plugins/subtitles.d.ts +10 -42
  45. package/plugins/thumbnails.d.ts +7 -42
  46. package/plugins/tizen.d.ts +7 -42
  47. package/plugins/vtsel.d.ts +7 -42
  48. package/plugins/webos.d.ts +7 -42
  49. package/util/loader.d.ts +7 -42
  50. package/util/loader.js +9 -8
@@ -4,8 +4,6 @@ import type { BitrateInfo } from 'dashjs';
4
4
  import type { Get } from 'type-fest';
5
5
  import type { HlsConfig } from 'hls.js';
6
6
  import type { Level } from 'hls.js';
7
- import type { MediaKeyFunc } from 'hls.js';
8
- import type { SetFieldType } from 'type-fest';
9
7
  import type { TupleToUnion } from 'type-fest';
10
8
 
11
9
  /**
@@ -272,41 +270,6 @@ declare const DESTROYED = "is-destroyed";
272
270
 
273
271
  declare const DISABLED = "is-disabled";
274
272
 
275
- /**
276
- * @public
277
- */
278
- declare type DRM_KEYSYSTEM = "com.widevine.alpha" | "com.microsoft.playready" | "org.w3.clearkey" | "com.apple.fps.1_0";
279
-
280
- /**
281
- * @public
282
- */
283
- declare type DRMConfiguration = {
284
- license_server: string;
285
- http_headers?: Record<string, string>;
286
- certificate?: string;
287
- vendor?: string | DRMVendorImplementation;
288
- request_media_key_system_access_function?: MediaKeyFunc;
289
- query_params?: Record<string, string>;
290
- };
291
-
292
- /**
293
- * @public
294
- */
295
- declare type DRMSourceConfiguration = {
296
- [keysystem in DRM_KEYSYSTEM]?: DRMConfiguration;
297
- };
298
-
299
- /**
300
- * @public
301
- */
302
- declare type DRMVendorImplementation = {
303
- fairplay_fetch_certificate: (url: string, cb: (certificate_data: Uint8Array) => void) => void;
304
- fairplay_request_license: (url: string, params: {
305
- message: any;
306
- assetId: string;
307
- }, cb: (license_data: Uint8Array) => void) => void;
308
- };
309
-
310
273
  /**
311
274
  * @public
312
275
  */
@@ -533,13 +496,13 @@ declare interface FlowplayerUMDWithPlugins<ConfigWithPlugins extends Config = Co
533
496
  * @param selector - query selector of the HTML element where player will render
534
497
  * @param config - Configuration of the flowplayer and the attached plugins
535
498
  */
536
- (selector: string, config?: ConfigWithPlugins): WithOpts<PluginPlayer, ConfigWithPlugins>;
499
+ (selector: string, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
537
500
  /**
538
501
  * Configure flowplayer, it's attached plugins and display flowplayer it in the UI
539
502
  * @param element - HTML element where player will render
540
503
  * @param config - Configuration of the flowplayer and the attached plugins
541
504
  */
542
- (element: HTMLElement, config?: ConfigWithPlugins): WithOpts<PluginPlayer, ConfigWithPlugins>;
505
+ (element: HTMLElement, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
543
506
  }
544
507
 
545
508
  /**
@@ -1158,6 +1121,11 @@ declare type PlayerState = FlowplayerStates[keyof FlowplayerStates];
1158
1121
  */
1159
1122
  declare type PlayerWith<T> = T & Player;
1160
1123
 
1124
+ declare type PlayerWithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = Omit<PluginPlayer, "opts" | "setOpts"> & {
1125
+ opts: PluginConfig;
1126
+ setOpts: (config: PluginConfig) => void;
1127
+ };
1128
+
1161
1129
  declare const PLAYING = "is-playing";
1162
1130
 
1163
1131
  /**
@@ -1486,7 +1454,6 @@ declare type SourceObj<T = unknown> = {
1486
1454
  * the MIME type (example `video/mp4` or `application/x-mpegurl`)
1487
1455
  */
1488
1456
  type?: string;
1489
- drm?: DRMSourceConfiguration;
1490
1457
  } & T;
1491
1458
 
1492
1459
  /**
@@ -1710,6 +1677,4 @@ declare const WILL_PLAY = "will-play";
1710
1677
 
1711
1678
  declare const WILL_SEEK = "will-seek";
1712
1679
 
1713
- declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = SetFieldType<SetFieldType<PluginPlayer, "opts", PluginConfig>, "setOpts", (config: PluginConfig) => void>;
1714
-
1715
1680
  export { }
@@ -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
  /**
@@ -268,41 +266,6 @@ declare const DESTROYED = "is-destroyed";
268
266
 
269
267
  declare const DISABLED = "is-disabled";
270
268
 
271
- /**
272
- * @public
273
- */
274
- declare type DRM_KEYSYSTEM = "com.widevine.alpha" | "com.microsoft.playready" | "org.w3.clearkey" | "com.apple.fps.1_0";
275
-
276
- /**
277
- * @public
278
- */
279
- declare type DRMConfiguration = {
280
- license_server: string;
281
- http_headers?: Record<string, string>;
282
- certificate?: string;
283
- vendor?: string | DRMVendorImplementation;
284
- request_media_key_system_access_function?: MediaKeyFunc;
285
- query_params?: Record<string, string>;
286
- };
287
-
288
- /**
289
- * @public
290
- */
291
- declare type DRMSourceConfiguration = {
292
- [keysystem in DRM_KEYSYSTEM]?: DRMConfiguration;
293
- };
294
-
295
- /**
296
- * @public
297
- */
298
- declare type DRMVendorImplementation = {
299
- fairplay_fetch_certificate: (url: string, cb: (certificate_data: Uint8Array) => void) => void;
300
- fairplay_request_license: (url: string, params: {
301
- message: any;
302
- assetId: string;
303
- }, cb: (license_data: Uint8Array) => void) => void;
304
- };
305
-
306
269
  /**
307
270
  * @public
308
271
  */
@@ -529,13 +492,13 @@ declare interface FlowplayerUMDWithPlugins<ConfigWithPlugins extends Config = Co
529
492
  * @param selector - query selector of the HTML element where player will render
530
493
  * @param config - Configuration of the flowplayer and the attached plugins
531
494
  */
532
- (selector: string, config?: ConfigWithPlugins): WithOpts<PluginPlayer, ConfigWithPlugins>;
495
+ (selector: string, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
533
496
  /**
534
497
  * Configure flowplayer, it's attached plugins and display flowplayer it in the UI
535
498
  * @param element - HTML element where player will render
536
499
  * @param config - Configuration of the flowplayer and the attached plugins
537
500
  */
538
- (element: HTMLElement, config?: ConfigWithPlugins): WithOpts<PluginPlayer, ConfigWithPlugins>;
501
+ (element: HTMLElement, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
539
502
  }
540
503
 
541
504
  /**
@@ -1152,6 +1115,11 @@ declare type PlayerState = FlowplayerStates[keyof FlowplayerStates];
1152
1115
  */
1153
1116
  declare type PlayerWith<T> = T & Player;
1154
1117
 
1118
+ declare type PlayerWithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = Omit<PluginPlayer, "opts" | "setOpts"> & {
1119
+ opts: PluginConfig;
1120
+ setOpts: (config: PluginConfig) => void;
1121
+ };
1122
+
1155
1123
  declare const PLAYING = "is-playing";
1156
1124
 
1157
1125
  /**
@@ -1480,7 +1448,6 @@ declare type SourceObj<T = unknown> = {
1480
1448
  * the MIME type (example `video/mp4` or `application/x-mpegurl`)
1481
1449
  */
1482
1450
  type?: string;
1483
- drm?: DRMSourceConfiguration;
1484
1451
  } & T;
1485
1452
 
1486
1453
  /**
@@ -1704,6 +1671,4 @@ declare const WILL_PLAY = "will-play";
1704
1671
 
1705
1672
  declare const WILL_SEEK = "will-seek";
1706
1673
 
1707
- declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = SetFieldType<SetFieldType<PluginPlayer, "opts", PluginConfig>, "setOpts", (config: PluginConfig) => void>;
1708
-
1709
1674
  export { }
@@ -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.analytics=t())}(this,(function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e){var t={exports:{}};return e(t,t.exports),t.exports}var n,r=t((function(t,n){var r=e&&e.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};n.__esModule=!0,n.remove=n.downcase=n.pluck=n.merge=void 0,n.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce((function(e,t){return r(r({},e),t)}),{})},n.pluck=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return Object.keys(e).filter((function(e){return~t.indexOf(e)})).reduce((function(t,r){var i;return n.merge(t,((i={})[r]=e[r],i))}),{})},n.downcase=function(e){return(e||"").toString().toLowerCase()},n.remove=function(e,t){var n=e.lastIndexOf(t);return~n&&e.splice(n,1),e}})),i=t((function(t,n){var i=e&&e.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&i(t,e,n);return o(t,e),t};n.__esModule=!0;var u=a(r),s=function(){function e(){this.pending=[],this.open=[],this.stats={failures:0,ttl:0}}return e.of=function(){return new e},e.is_empty=function(e){return 0==e.pending.length},e.is_high_water=function(t){return t.open.length==e.MAX_OPEN_REQUESTS},e.maybe_spawn_req=function(t){if(e.is_empty(t))return t;if(e.is_high_water(t))return t;try{var n=e.lpop(t);n&&e.request(t,n)}catch(e){}},e.increment_failures=function(t){return t.stats.failures++,t.stats.failures>e.MAX_FAILURE_COUNT&&(t.stats.ttl=Date.now()+e.REQUEST_TTL_MS),t},e.handle_error=function(t,n){e.rm(t,n),e.increment_failures(t)},e.request=function(t,n){var r=n[0],i=n[1],o=n[2];if(!(Date.now()<t.stats.ttl)){var a=new XMLHttpRequest;t.open.push(a),a.timeout=e.REQUEST_TIMEOUT_MS,a.ontimeout=function(){e.handle_error(t,a)},a.onerror=function(n){e.handle_error(t,a)},a.onreadystatechange=function(){a.readyState==XMLHttpRequest.DONE&&e.rm(t,a),Math.floor(a.status/100)},a.onload=function(){e.rm(t,a),t.stats.failures&&t.stats.failures--},a.open(i,r),a.setRequestHeader("Content-Type","text/plain;charset=UTF-8");try{a.send(JSON.stringify(o))}catch(e){}}},e.rpush=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return n.forEach((function(n){t.pending.length>=e.MAX_PENDING||(t.pending.push(n),e.maybe_spawn_req(t))})),t},e.lpop=function(e){return e.pending.shift()},e.rm=function(e,t){return u.remove(e.open,t),e},e.MAX_OPEN_REQUESTS=3,e.MAX_PENDING=5,e.REQUEST_TIMEOUT_MS=4e3,e.REQUEST_TTL_MS=5e3,e.MAX_FAILURE_COUNT=3,e}();n.default=s})),o=t((function(t,n){var r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};n.__esModule=!0;var o=r(i);n.default=o.default.of()})),a=t((function(e,t){t.__esModule=!0,t.prepare_url=t.URL_PARAM=void 0,t.URL_PARAM=/:([a-zA-Z_]+)/g,t.prepare_url=function(e,n){return e.url.replace(t.URL_PARAM,(function(t){if((t=t.slice(1,t.length))in n)return n[t].toString();e.log.error(new Error("\n preparing url["+e.url+"] failed\n \n parameter["+t+"] not detected in params:\n \n "+JSON.stringify(n,null,2)+"\n "))}))}})),u=t((function(e,t){t.__esModule=!0,t.Log=void 0;var n=function(){function e(e){this.emitter=e}return e.prepare=function(e,t){var n=document.createEvent("Event");return n.initEvent(e,!1,!0),n.ns=e,n.data=t,n},e.of=function(t){return new e(t)},e.prototype.info=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.INFO,t))},e.prototype.error=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.ERROR,t))},e.prototype.warn=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.WARN,t))},e.NAMESPACE={INFO:"tracker:info",ERROR:"tracker:err",WARN:"tracker:warn"},e}();t.Log=n})),s=t((function(e,t){var n;t.__esModule=!0,t.Verb=void 0,(n=t.Verb||(t.Verb={})).POST="POST",n.PUT="PUT",n.GET="GET"})),d=t((function(t,n){var d=e&&e.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),c=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),f=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&d(t,e,n);return c(t,e),t},l=e&&e.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,u=o.length;a<u;a++,i++)r[i]=o[a];return r},p=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};n.__esModule=!0;var _=p(o),v=p(i),m=f(a),h=f(r),y=function(){function e(t,n){var r=this;void 0===n&&(n={});var i=this;if(this.emitter=t,this.url=n.url,this.log=u.Log.of(this.emitter),this.verb=n.verb,this.metadata=h.merge({},n.metadata||{}),this.rq=n.rq||_.default,this.events=n.events||[],this.required_keys=n.required_keys||[],this.optional_keys=n.optional_keys||[],this.listeners=[],this.valid_keys=this.required_keys.slice(0).concat(this.optional_keys),e.assert_emitter_api(this.emitter),void 0===e.verb[this.verb])throw new Error("invalid HTTP verb["+this.verb+"] passed");if("string"!=typeof this.url)throw new Error("invalid API url["+this.url+"] passed");e.TRACKERS.push(this),i.events.forEach((function(t){e.create_listener(r,t,(function(n){void 0===n&&(n={});var o=h.merge(i.metadata,{event_type:t},n.data||n),a=m.prepare_url(i,o),u=e.pluck_valid_keys(i,o),s=e.ensure_required_keys(i,u);if(s.length)return i.log.error("Tracker.validate_metadata() failed for \n Event["+t+"]\n missing keys: "+s+"\n payload:\n "+JSON.stringify(u,null,2));v.default.rpush(r.rq,[a,r.verb,u])}))}))}return e.of=function(t,n){return new e(t,n)},e.ensure_required_keys=function(e,t){return e.required_keys.filter((function(e){return!(e in t)}))},e.pluck_valid_keys=function(e,t){return h.pluck.apply(h,l([t],e.valid_keys))},e.merge_metadata=function(t,n){return void 0===n&&(n={}),t.metadata=e.pluck_valid_keys(t,h.merge(t.metadata,n)),t},e.assert_emitter_api=function(e){if("function"!=typeof(e||{}).addEventListener)throw new Error("Tracker() received an emitter that does not implement the addEventListener method");if("function"!=typeof(e||{}).removeEventListener)throw new Error("Tracker() received an emitter that does not implement the removeEventListener method")},e.create_listener=function(e,t,n){e.listeners.push([t,n]),e.emitter.addEventListener(t,n)},e.prototype.destroy=function(){var t=this;this.listeners.forEach((function(e){var n=e[0],r=e[1];return t.emitter.removeEventListener(n,r)})),delete this.rq,delete this.emitter,h.remove(e.TRACKERS,this)},e.prototype.put=function(t){return void 0===t&&(t={}),e.merge_metadata(this,t),this},e.TRACKERS=[],e.QUEUE=_.default,e.verb=s.Verb,e}();n.default=y})),c=t((function(t,n){var r=e&&e.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},u=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};n.__esModule=!0,n.API=n.Tracker=void 0;var s=u(d);n.Tracker=s.default;var c=o(a);n.API=c}));!function(e){e[e.ADS=2]="ADS",e[e.ANALYTICS=4]="ANALYTICS",e[e.NO_METERING=8]="NO_METERING",e[e.DEVELOPER_PLAN=16]="DEVELOPER_PLAN",e[e.WOWZA_VIDEO=32]="WOWZA_VIDEO"}(n||(n={}));const f=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function l(e,t){return!!~f.indexOf(e)||e.indexOf(t)===e.length-t.length}l.check_whitelist=function(e){return!!~f.indexOf(e)};function p(e){this.message=e}p.prototype=new Error,p.prototype.name="InvalidCharacterError";var _="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new p("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,i=0,o=0,a="";r=t.charAt(o++);~r&&(n=i%4?64*n+r:r,i++%4)?a+=String.fromCharCode(255&n>>(-2*i&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return a};var v=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(_(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return _(t)}};function m(e){this.message=e}m.prototype=new Error,m.prototype.name="InvalidTokenError";var h=function(e,t){if("string"!=typeof e)throw new m("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(v(e.split(".")[n]))}catch(e){throw new m("Invalid token specified: "+e.message)}};h.InvalidTokenError=m;const y="production";function g(e,t){const n={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let r={c:"{}",exp:0};t=t||{};try{r=h(e),n.valid_jwt=!0}catch(e){}return n.raw=e,n.data=JSON.parse(r.c),n.exp=r.exp,t.require_valid_token&&g.validate(n),n}function w(e){return{grant:e,is_granted:t=>(e&t)===t}}function k(e,t,n){const r=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;r.length;){if(null==e)return n;const t=r.shift();if("string"!=typeof t)return n;e=e[t]}return null==e?n:e}g.validate=function(e){if("string"==typeof e&&(e=g(e)),!e||!e.raw){if(l.check_whitelist(window.location.hostname)||"dev"===y.toString())return!0;throw new Error("No token provided in configuration")}if(!e.valid_jwt)throw new Error("Invalid token provided");const t=window.location.hostname,n=l.bind(null,t);if("dev"!==y.toString()&&e.data.domain&&e.data.domain.length&&!e.data.domain.some(n))throw new Error("Domain not allowed");if("dev"!==y.toString()&&1e3*e.exp-Date.now()<0)throw new Error("Expired token");return!0},g.id=function(e){if(e)return"string"==typeof e&&(e=g(e)),e.data.id},w.of=w,w.from_token=function(e){const t=g(e,{require_valid_token:!0});return w.of(t.data.acl)},w.permissions=n;var E="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};var b="ping",O="display",A="view";const T=["sitegroup_id","session_id","media_id","site_id","player_id","video_type"],S=["created","position"],M=["player_version","created","source","category","category_id","autoplay","muted","customer_user_id"];function P(e,t){return e.duration/1===e.duration&&Object.assign(t,function(e){const t=e/100;return{segment_duration:t,breakpoints:Array(...Array(100)).map((function(e,n){return Math.floor(n*t*1e3)/1e3}))}}(e.duration))}function R(e,t,n){if(!t.segment_duration&&!P(e,t))return;const r=function(e,t,n){const r=t.last_idx,i=n?99:x(e,t);return t.last_idx=i,i<=r?[]:t.breakpoints.slice(r,99==i?100:i).map((function(e){return t.breakpoints.indexOf(e)}))}(e,t,n);0!=r.length&&e.emit(b,{position:r})}function x(e,t){return Math.min(Math.floor(e.currentTime/t.segment_duration),99)}function N(){try{const e=window.location!==window.parent.location?document.referrer:document.location.href;return"string"==typeof e&&e.slice(0,200)}catch(e){return!1}}const I="vod",L="live",j=[O,b,A];function q(e,t,n){switch(null==t?void 0:t.kind){case"live":return function(e,t){const n=Date.now();n-t.last_tracked_ts<6e4||(t.last_tracked_ts=n,++t.ticks,e.emit(b,{position:60*t.ticks}))}(e,t);case"vod":return R(e,t,"boolean"==typeof n&&n)}}function U(e){const t=e.ads;return void 0!==t&&(void 0!==t.schedule&&("function"==typeof t.hasPreroll&&(t.currentRequests?t.currentRequests:!!t.adPlaying||!(!t.hasPreroll()||0!=t.nextIndex))))}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)}("undefined"!=typeof window?window:void 0!==E?E:{},class Analytics{init(e,t,n){if(!w.from_token(e.token||"").is_granted(w.permissions.ANALYTICS))return;if(n.hasState("consent-no-tracking"))return;if(n.analytics)return;const r=n.analytics={ticker:void 0,last_media_id:"",ended:!1},i={locked:void 0,ttl:6e3,task:()=>{q(n,r.ticker)}};const o={session_id:n.deviceId(),autoplay:n.autoplay,muted:n.muted,player_id:e.player_id,customer_user_id:e.customer_user_id,player_version:"3.23.0"},a=c.Tracker.of(n,{verb:c.Tracker.verb.POST,url:"https://ptm.flowplayer.com/:video_type/:sitegroup_id/:event_type",events:j,required_keys:T,optional_keys:M.concat(S).slice(0),metadata:o});n.on("reap",(function(){a&&a.destroy()})),n.on("config",(function(t){if(!a)return;const i=k(t,"data.metadata",{});if(!i.media_id)return;const o=k(a,"metadata.media_id");if(o&&i.media_id==o)return;const u=k(e,"analytics",{});a.put(i),a.put(u);const s=k(e,"metadata.live_start_time",e.live)?L:I;a.put({video_type:s,source:e.source||N()||""}),r.ticker=e.live?{ticks:0,last_tracked_ts:Date.now(),kind:"live"}:{last_idx:0,segment_duration:0,breakpoints:[],kind:"vod"},r.ended=!1,n.emit(O)}));let u=0;n.on("playing",(function(){if(!a)return;if(u||function(e,t){return e.metadata.media_id&&e.metadata.media_id==t.last_media_id}(a,r))return;a.put({muted:n.muted});const e=U(n);if(e)return u=Promise.resolve(e).then((function(){r.last_media_id=a.metadata.media_id,n.emit(A),u=0})).catch((function(){u=0}));r.last_media_id=a.metadata.media_id,n.emit(A)})),n.on("timeupdate",(function(){var t;a&&(u||U(n)||r.ended||(!e.live&&n.currentTime+.25>=n.duration&&q(n,r.ticker,!0),(t=i).locked||(t.locked=setTimeout((function(){return t.task(),function(e){return e.locked=void 0,e}(t)}),t.ttl))))})),n.on("seeked",(function(){a&&r.ticker&&"vod"==r.ticker.kind&&function(e,t){P(e,t),t.last_idx=x(e,t)}(n,r.ticker)})),n.on("ended",(function(){a&&function(e,t){t.ended||(t.ended=!0,q(e,t.ticker))}(n,r)}))}})}));
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.analytics=t())}(this,(function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e){var t={exports:{}};return e(t,t.exports),t.exports}var n,r=t((function(t,n){var r=e&&e.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};n.__esModule=!0,n.remove=n.downcase=n.pluck=n.merge=void 0,n.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce((function(e,t){return r(r({},e),t)}),{})},n.pluck=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return Object.keys(e).filter((function(e){return~t.indexOf(e)})).reduce((function(t,r){var i;return n.merge(t,((i={})[r]=e[r],i))}),{})},n.downcase=function(e){return(e||"").toString().toLowerCase()},n.remove=function(e,t){var n=e.lastIndexOf(t);return~n&&e.splice(n,1),e}})),i=t((function(t,n){var i=e&&e.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&i(t,e,n);return o(t,e),t};n.__esModule=!0;var u=a(r),s=function(){function e(){this.pending=[],this.open=[],this.stats={failures:0,ttl:0}}return e.of=function(){return new e},e.is_empty=function(e){return 0==e.pending.length},e.is_high_water=function(t){return t.open.length==e.MAX_OPEN_REQUESTS},e.maybe_spawn_req=function(t){if(e.is_empty(t))return t;if(e.is_high_water(t))return t;try{var n=e.lpop(t);n&&e.request(t,n)}catch(e){}},e.increment_failures=function(t){return t.stats.failures++,t.stats.failures>e.MAX_FAILURE_COUNT&&(t.stats.ttl=Date.now()+e.REQUEST_TTL_MS),t},e.handle_error=function(t,n){e.rm(t,n),e.increment_failures(t)},e.request=function(t,n){var r=n[0],i=n[1],o=n[2];if(!(Date.now()<t.stats.ttl)){var a=new XMLHttpRequest;t.open.push(a),a.timeout=e.REQUEST_TIMEOUT_MS,a.ontimeout=function(){e.handle_error(t,a)},a.onerror=function(n){e.handle_error(t,a)},a.onreadystatechange=function(){a.readyState==XMLHttpRequest.DONE&&e.rm(t,a),Math.floor(a.status/100)},a.onload=function(){e.rm(t,a),t.stats.failures&&t.stats.failures--},a.open(i,r),a.setRequestHeader("Content-Type","text/plain;charset=UTF-8");try{a.send(JSON.stringify(o))}catch(e){}}},e.rpush=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return n.forEach((function(n){t.pending.length>=e.MAX_PENDING||(t.pending.push(n),e.maybe_spawn_req(t))})),t},e.lpop=function(e){return e.pending.shift()},e.rm=function(e,t){return u.remove(e.open,t),e},e.MAX_OPEN_REQUESTS=3,e.MAX_PENDING=5,e.REQUEST_TIMEOUT_MS=4e3,e.REQUEST_TTL_MS=5e3,e.MAX_FAILURE_COUNT=3,e}();n.default=s})),o=t((function(t,n){var r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};n.__esModule=!0;var o=r(i);n.default=o.default.of()})),a=t((function(e,t){t.__esModule=!0,t.prepare_url=t.URL_PARAM=void 0,t.URL_PARAM=/:([a-zA-Z_]+)/g,t.prepare_url=function(e,n){return e.url.replace(t.URL_PARAM,(function(t){if((t=t.slice(1,t.length))in n)return n[t].toString();e.log.error(new Error("\n preparing url["+e.url+"] failed\n \n parameter["+t+"] not detected in params:\n \n "+JSON.stringify(n,null,2)+"\n "))}))}})),u=t((function(e,t){t.__esModule=!0,t.Log=void 0;var n=function(){function e(e){this.emitter=e}return e.prepare=function(e,t){var n=document.createEvent("Event");return n.initEvent(e,!1,!0),n.ns=e,n.data=t,n},e.of=function(t){return new e(t)},e.prototype.info=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.INFO,t))},e.prototype.error=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.ERROR,t))},e.prototype.warn=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.WARN,t))},e.NAMESPACE={INFO:"tracker:info",ERROR:"tracker:err",WARN:"tracker:warn"},e}();t.Log=n})),s=t((function(e,t){var n;t.__esModule=!0,t.Verb=void 0,(n=t.Verb||(t.Verb={})).POST="POST",n.PUT="PUT",n.GET="GET"})),d=t((function(t,n){var d=e&&e.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),c=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),f=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&d(t,e,n);return c(t,e),t},l=e&&e.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,u=o.length;a<u;a++,i++)r[i]=o[a];return r},p=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};n.__esModule=!0;var _=p(o),v=p(i),m=f(a),h=f(r),y=function(){function e(t,n){var r=this;void 0===n&&(n={});var i=this;if(this.emitter=t,this.url=n.url,this.log=u.Log.of(this.emitter),this.verb=n.verb,this.metadata=h.merge({},n.metadata||{}),this.rq=n.rq||_.default,this.events=n.events||[],this.required_keys=n.required_keys||[],this.optional_keys=n.optional_keys||[],this.listeners=[],this.valid_keys=this.required_keys.slice(0).concat(this.optional_keys),e.assert_emitter_api(this.emitter),void 0===e.verb[this.verb])throw new Error("invalid HTTP verb["+this.verb+"] passed");if("string"!=typeof this.url)throw new Error("invalid API url["+this.url+"] passed");e.TRACKERS.push(this),i.events.forEach((function(t){e.create_listener(r,t,(function(n){void 0===n&&(n={});var o=h.merge(i.metadata,{event_type:t},n.data||n),a=m.prepare_url(i,o),u=e.pluck_valid_keys(i,o),s=e.ensure_required_keys(i,u);if(s.length)return i.log.error("Tracker.validate_metadata() failed for \n Event["+t+"]\n missing keys: "+s+"\n payload:\n "+JSON.stringify(u,null,2));v.default.rpush(r.rq,[a,r.verb,u])}))}))}return e.of=function(t,n){return new e(t,n)},e.ensure_required_keys=function(e,t){return e.required_keys.filter((function(e){return!(e in t)}))},e.pluck_valid_keys=function(e,t){return h.pluck.apply(h,l([t],e.valid_keys))},e.merge_metadata=function(t,n){return void 0===n&&(n={}),t.metadata=e.pluck_valid_keys(t,h.merge(t.metadata,n)),t},e.assert_emitter_api=function(e){if("function"!=typeof(e||{}).addEventListener)throw new Error("Tracker() received an emitter that does not implement the addEventListener method");if("function"!=typeof(e||{}).removeEventListener)throw new Error("Tracker() received an emitter that does not implement the removeEventListener method")},e.create_listener=function(e,t,n){e.listeners.push([t,n]),e.emitter.addEventListener(t,n)},e.prototype.destroy=function(){var t=this;this.listeners.forEach((function(e){var n=e[0],r=e[1];return t.emitter.removeEventListener(n,r)})),delete this.rq,delete this.emitter,h.remove(e.TRACKERS,this)},e.prototype.put=function(t){return void 0===t&&(t={}),e.merge_metadata(this,t),this},e.TRACKERS=[],e.QUEUE=_.default,e.verb=s.Verb,e}();n.default=y})),c=t((function(t,n){var r=e&&e.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},u=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};n.__esModule=!0,n.API=n.Tracker=void 0;var s=u(d);n.Tracker=s.default;var c=o(a);n.API=c}));!function(e){e[e.ADS=2]="ADS",e[e.ANALYTICS=4]="ANALYTICS",e[e.NO_METERING=8]="NO_METERING",e[e.DEVELOPER_PLAN=16]="DEVELOPER_PLAN",e[e.WOWZA_VIDEO=32]="WOWZA_VIDEO"}(n||(n={}));const f=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function l(e,t){return!!~f.indexOf(e)||e.indexOf(t)===e.length-t.length}l.check_whitelist=function(e){return!!~f.indexOf(e)};function p(e){this.message=e}p.prototype=new Error,p.prototype.name="InvalidCharacterError";var _="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new p("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,i=0,o=0,a="";r=t.charAt(o++);~r&&(n=i%4?64*n+r:r,i++%4)?a+=String.fromCharCode(255&n>>(-2*i&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return a};var v=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(_(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return _(t)}};function m(e){this.message=e}m.prototype=new Error,m.prototype.name="InvalidTokenError";var h=function(e,t){if("string"!=typeof e)throw new m("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(v(e.split(".")[n]))}catch(e){throw new m("Invalid token specified: "+e.message)}};h.InvalidTokenError=m;const y="production";function g(e,t){const n={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let r={c:"{}",exp:0};t=t||{};try{r=h(e),n.valid_jwt=!0}catch(e){}return n.raw=e,n.data=JSON.parse(r.c),n.exp=r.exp,t.require_valid_token&&g.validate(n),n}function w(e){return{grant:e,is_granted:t=>(e&t)===t}}function k(e,t,n){const r=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;r.length;){if(null==e)return n;const t=r.shift();if("string"!=typeof t)return n;e=e[t]}return null==e?n:e}g.validate=function(e){if("string"==typeof e&&(e=g(e)),!e||!e.raw){if(l.check_whitelist(window.location.hostname)||"dev"===y.toString())return!0;throw new Error("No token provided in configuration")}if(!e.valid_jwt)throw new Error("Invalid token provided");const t=window.location.hostname,n=l.bind(null,t);if("dev"!==y.toString()&&e.data.domain&&e.data.domain.length&&!e.data.domain.some(n))throw new Error("Domain not allowed");if("dev"!==y.toString()&&1e3*e.exp-Date.now()<0)throw new Error("Expired token");return!0},g.id=function(e){if(e)return"string"==typeof e&&(e=g(e)),e.data.id},w.of=w,w.from_token=function(e){const t=g(e,{require_valid_token:!0});return w.of(t.data.acl)},w.permissions=n;var E="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};var b="ping",O="display",A="view";const T=["sitegroup_id","session_id","media_id","site_id","player_id","video_type"],S=["created","position"],M=["player_version","created","source","category","category_id","autoplay","muted","customer_user_id"];function P(e,t){return e.duration/1===e.duration&&Object.assign(t,function(e){const t=e/100;return{segment_duration:t,breakpoints:Array(...Array(100)).map((function(e,n){return Math.floor(n*t*1e3)/1e3}))}}(e.duration))}function R(e,t,n){if(!t.segment_duration&&!P(e,t))return;const r=function(e,t,n){const r=t.last_idx,i=n?99:x(e,t);return t.last_idx=i,i<=r?[]:t.breakpoints.slice(r,99==i?100:i).map((function(e){return t.breakpoints.indexOf(e)}))}(e,t,n);0!=r.length&&e.emit(b,{position:r})}function x(e,t){return Math.min(Math.floor(e.currentTime/t.segment_duration),99)}function N(){try{const e=window.location!==window.parent.location?document.referrer:document.location.href;return"string"==typeof e&&e.slice(0,200)}catch(e){return!1}}const I="vod",L="live",j=[O,b,A];function q(e,t,n){switch(null==t?void 0:t.kind){case"live":return function(e,t){const n=Date.now();n-t.last_tracked_ts<6e4||(t.last_tracked_ts=n,++t.ticks,e.emit(b,{position:60*t.ticks}))}(e,t);case"vod":return R(e,t,"boolean"==typeof n&&n)}}function U(e){const t=e.ads;return void 0!==t&&(void 0!==t.schedule&&("function"==typeof t.hasPreroll&&(t.currentRequests?t.currentRequests:!!t.adPlaying||!(!t.hasPreroll()||0!=t.nextIndex))))}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)}("undefined"!=typeof window?window:void 0!==E?E:{},class Analytics{init(e,t,n){if(!w.from_token(e.token||"").is_granted(w.permissions.ANALYTICS))return;if(n.hasState("consent-no-tracking"))return;if(n.analytics)return;const r=n.analytics={ticker:void 0,last_media_id:"",ended:!1},i={locked:void 0,ttl:6e3,task:()=>{q(n,r.ticker)}};const o={session_id:n.deviceId(),autoplay:n.autoplay,muted:n.muted,player_id:e.player_id,customer_user_id:e.customer_user_id,player_version:"3.24.0-rc.1"},a=c.Tracker.of(n,{verb:c.Tracker.verb.POST,url:"https://ptm.flowplayer.com/:video_type/:sitegroup_id/:event_type",events:j,required_keys:T,optional_keys:M.concat(S).slice(0),metadata:o});n.on("reap",(function(){a&&a.destroy()})),n.on("config",(function(t){if(!a)return;const i=k(t,"data.metadata",{});if(!i.media_id)return;const o=k(a,"metadata.media_id");if(o&&i.media_id==o)return;const u=k(e,"analytics",{});a.put(i),a.put(u);const s=k(e,"metadata.live_start_time",e.live)?L:I;a.put({video_type:s,source:e.source||N()||""}),r.ticker=e.live?{ticks:0,last_tracked_ts:Date.now(),kind:"live"}:{last_idx:0,segment_duration:0,breakpoints:[],kind:"vod"},r.ended=!1,n.emit(O)}));let u=0;n.on("playing",(function(){if(!a)return;if(u||function(e,t){return e.metadata.media_id&&e.metadata.media_id==t.last_media_id}(a,r))return;a.put({muted:n.muted});const e=U(n);if(e)return u=Promise.resolve(e).then((function(){r.last_media_id=a.metadata.media_id,n.emit(A),u=0})).catch((function(){u=0}));r.last_media_id=a.metadata.media_id,n.emit(A)})),n.on("timeupdate",(function(){var t;a&&(u||U(n)||r.ended||(!e.live&&n.currentTime+.25>=n.duration&&q(n,r.ticker,!0),(t=i).locked||(t.locked=setTimeout((function(){return t.task(),function(e){return e.locked=void 0,e}(t)}),t.ttl))))})),n.on("seeked",(function(){a&&r.ticker&&"vod"==r.ticker.kind&&function(e,t){P(e,t),t.last_idx=x(e,t)}(n,r.ticker)})),n.on("ended",(function(){a&&function(e,t){t.ended||(t.ended=!0,q(e,t.ticker))}(n,r)}))}})}));
package/plugins/asel.d.ts CHANGED
@@ -5,8 +5,6 @@ import type { Get } from 'type-fest';
5
5
  import type Hls from 'hls.js';
6
6
  import type { Level } from 'hls.js';
7
7
  import type { LevelAttributes } from 'hls.js';
8
- import type { MediaKeyFunc } from 'hls.js';
9
- import type { SetFieldType } from 'type-fest';
10
8
  import type { TupleToUnion } from 'type-fest';
11
9
 
12
10
  /* Excluded from this release type: AnyLoader */
@@ -377,41 +375,6 @@ declare const DESTROYED = "is-destroyed";
377
375
 
378
376
  declare const DISABLED = "is-disabled";
379
377
 
380
- /**
381
- * @public
382
- */
383
- declare type DRM_KEYSYSTEM = "com.widevine.alpha" | "com.microsoft.playready" | "org.w3.clearkey" | "com.apple.fps.1_0";
384
-
385
- /**
386
- * @public
387
- */
388
- declare type DRMConfiguration = {
389
- license_server: string;
390
- http_headers?: Record<string, string>;
391
- certificate?: string;
392
- vendor?: string | DRMVendorImplementation;
393
- request_media_key_system_access_function?: MediaKeyFunc;
394
- query_params?: Record<string, string>;
395
- };
396
-
397
- /**
398
- * @public
399
- */
400
- declare type DRMSourceConfiguration = {
401
- [keysystem in DRM_KEYSYSTEM]?: DRMConfiguration;
402
- };
403
-
404
- /**
405
- * @public
406
- */
407
- declare type DRMVendorImplementation = {
408
- fairplay_fetch_certificate: (url: string, cb: (certificate_data: Uint8Array) => void) => void;
409
- fairplay_request_license: (url: string, params: {
410
- message: any;
411
- assetId: string;
412
- }, cb: (license_data: Uint8Array) => void) => void;
413
- };
414
-
415
378
  /**
416
379
  * @public
417
380
  */
@@ -646,13 +609,13 @@ declare interface FlowplayerUMDWithPlugins<ConfigWithPlugins extends Config = Co
646
609
  * @param selector - query selector of the HTML element where player will render
647
610
  * @param config - Configuration of the flowplayer and the attached plugins
648
611
  */
649
- (selector: string, config?: ConfigWithPlugins): WithOpts<PluginPlayer, ConfigWithPlugins>;
612
+ (selector: string, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
650
613
  /**
651
614
  * Configure flowplayer, it's attached plugins and display flowplayer it in the UI
652
615
  * @param element - HTML element where player will render
653
616
  * @param config - Configuration of the flowplayer and the attached plugins
654
617
  */
655
- (element: HTMLElement, config?: ConfigWithPlugins): WithOpts<PluginPlayer, ConfigWithPlugins>;
618
+ (element: HTMLElement, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
656
619
  }
657
620
 
658
621
  /**
@@ -1269,6 +1232,11 @@ declare type PlayerState = FlowplayerStates[keyof FlowplayerStates];
1269
1232
  */
1270
1233
  declare type PlayerWith<T> = T & Player;
1271
1234
 
1235
+ declare type PlayerWithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = Omit<PluginPlayer, "opts" | "setOpts"> & {
1236
+ opts: PluginConfig;
1237
+ setOpts: (config: PluginConfig) => void;
1238
+ };
1239
+
1272
1240
  declare const PLAYING = "is-playing";
1273
1241
 
1274
1242
  /**
@@ -1607,7 +1575,6 @@ declare type SourceObj<T = unknown> = {
1607
1575
  * the MIME type (example `video/mp4` or `application/x-mpegurl`)
1608
1576
  */
1609
1577
  type?: string;
1610
- drm?: DRMSourceConfiguration;
1611
1578
  } & T;
1612
1579
 
1613
1580
  /**
@@ -1851,6 +1818,4 @@ declare const WILL_PLAY = "will-play";
1851
1818
 
1852
1819
  declare const WILL_SEEK = "will-seek";
1853
1820
 
1854
- declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = SetFieldType<SetFieldType<PluginPlayer, "opts", PluginConfig>, "setOpts", (config: PluginConfig) => void>;
1855
-
1856
1821
  export { }
@@ -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 */
@@ -268,41 +266,6 @@ declare const DESTROYED = "is-destroyed";
268
266
 
269
267
  declare const DISABLED = "is-disabled";
270
268
 
271
- /**
272
- * @public
273
- */
274
- declare type DRM_KEYSYSTEM = "com.widevine.alpha" | "com.microsoft.playready" | "org.w3.clearkey" | "com.apple.fps.1_0";
275
-
276
- /**
277
- * @public
278
- */
279
- declare type DRMConfiguration = {
280
- license_server: string;
281
- http_headers?: Record<string, string>;
282
- certificate?: string;
283
- vendor?: string | DRMVendorImplementation;
284
- request_media_key_system_access_function?: MediaKeyFunc;
285
- query_params?: Record<string, string>;
286
- };
287
-
288
- /**
289
- * @public
290
- */
291
- declare type DRMSourceConfiguration = {
292
- [keysystem in DRM_KEYSYSTEM]?: DRMConfiguration;
293
- };
294
-
295
- /**
296
- * @public
297
- */
298
- declare type DRMVendorImplementation = {
299
- fairplay_fetch_certificate: (url: string, cb: (certificate_data: Uint8Array) => void) => void;
300
- fairplay_request_license: (url: string, params: {
301
- message: any;
302
- assetId: string;
303
- }, cb: (license_data: Uint8Array) => void) => void;
304
- };
305
-
306
269
  /**
307
270
  * @public
308
271
  */
@@ -529,13 +492,13 @@ declare interface FlowplayerUMDWithPlugins<ConfigWithPlugins extends Config = Co
529
492
  * @param selector - query selector of the HTML element where player will render
530
493
  * @param config - Configuration of the flowplayer and the attached plugins
531
494
  */
532
- (selector: string, config?: ConfigWithPlugins): WithOpts<PluginPlayer, ConfigWithPlugins>;
495
+ (selector: string, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
533
496
  /**
534
497
  * Configure flowplayer, it's attached plugins and display flowplayer it in the UI
535
498
  * @param element - HTML element where player will render
536
499
  * @param config - Configuration of the flowplayer and the attached plugins
537
500
  */
538
- (element: HTMLElement, config?: ConfigWithPlugins): WithOpts<PluginPlayer, ConfigWithPlugins>;
501
+ (element: HTMLElement, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
539
502
  }
540
503
 
541
504
  /**
@@ -1152,6 +1115,11 @@ declare type PlayerState = FlowplayerStates[keyof FlowplayerStates];
1152
1115
  */
1153
1116
  declare type PlayerWith<T> = T & Player;
1154
1117
 
1118
+ declare type PlayerWithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = Omit<PluginPlayer, "opts" | "setOpts"> & {
1119
+ opts: PluginConfig;
1120
+ setOpts: (config: PluginConfig) => void;
1121
+ };
1122
+
1155
1123
  declare const PLAYING = "is-playing";
1156
1124
 
1157
1125
  /**
@@ -1480,7 +1448,6 @@ declare type SourceObj<T = unknown> = {
1480
1448
  * the MIME type (example `video/mp4` or `application/x-mpegurl`)
1481
1449
  */
1482
1450
  type?: string;
1483
- drm?: DRMSourceConfiguration;
1484
1451
  } & T;
1485
1452
 
1486
1453
  /**
@@ -1704,6 +1671,4 @@ declare const WILL_PLAY = "will-play";
1704
1671
 
1705
1672
  declare const WILL_SEEK = "will-seek";
1706
1673
 
1707
- declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = SetFieldType<SetFieldType<PluginPlayer, "opts", PluginConfig>, "setOpts", (config: PluginConfig) => void>;
1708
-
1709
1674
  export { }
@@ -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): WithOpts<PluginPlayer, 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): WithOpts<PluginPlayer, ConfigWithPlugins>;
503
+ (element: HTMLElement, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
541
504
  }
542
505
 
543
506
  /**
@@ -1154,6 +1117,11 @@ declare type PlayerState = FlowplayerStates[keyof FlowplayerStates];
1154
1117
  */
1155
1118
  declare type PlayerWith<T> = T & Player;
1156
1119
 
1120
+ declare type PlayerWithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = Omit<PluginPlayer, "opts" | "setOpts"> & {
1121
+ opts: PluginConfig;
1122
+ setOpts: (config: PluginConfig) => void;
1123
+ };
1124
+
1157
1125
  declare const PLAYING = "is-playing";
1158
1126
 
1159
1127
  /**
@@ -1482,7 +1450,6 @@ declare type SourceObj<T = unknown> = {
1482
1450
  * the MIME type (example `video/mp4` or `application/x-mpegurl`)
1483
1451
  */
1484
1452
  type?: string;
1485
- drm?: DRMSourceConfiguration;
1486
1453
  } & T;
1487
1454
 
1488
1455
  /**
@@ -1706,6 +1673,4 @@ declare const WILL_PLAY = "will-play";
1706
1673
 
1707
1674
  declare const WILL_SEEK = "will-seek";
1708
1675
 
1709
- declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = SetFieldType<SetFieldType<PluginPlayer, "opts", PluginConfig>, "setOpts", (config: PluginConfig) => void>;
1710
-
1711
1676
  export { }
@@ -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 */
@@ -331,41 +329,6 @@ declare const DESTROYED = "is-destroyed";
331
329
 
332
330
  declare const DISABLED = "is-disabled";
333
331
 
334
- /**
335
- * @public
336
- */
337
- declare type DRM_KEYSYSTEM = "com.widevine.alpha" | "com.microsoft.playready" | "org.w3.clearkey" | "com.apple.fps.1_0";
338
-
339
- /**
340
- * @public
341
- */
342
- declare type DRMConfiguration = {
343
- license_server: string;
344
- http_headers?: Record<string, string>;
345
- certificate?: string;
346
- vendor?: string | DRMVendorImplementation;
347
- request_media_key_system_access_function?: MediaKeyFunc;
348
- query_params?: Record<string, string>;
349
- };
350
-
351
- /**
352
- * @public
353
- */
354
- declare type DRMSourceConfiguration = {
355
- [keysystem in DRM_KEYSYSTEM]?: DRMConfiguration;
356
- };
357
-
358
- /**
359
- * @public
360
- */
361
- declare type DRMVendorImplementation = {
362
- fairplay_fetch_certificate: (url: string, cb: (certificate_data: Uint8Array) => void) => void;
363
- fairplay_request_license: (url: string, params: {
364
- message: any;
365
- assetId: string;
366
- }, cb: (license_data: Uint8Array) => void) => void;
367
- };
368
-
369
332
  /**
370
333
  * @public
371
334
  */
@@ -592,13 +555,13 @@ declare interface FlowplayerUMDWithPlugins<ConfigWithPlugins extends Config = Co
592
555
  * @param selector - query selector of the HTML element where player will render
593
556
  * @param config - Configuration of the flowplayer and the attached plugins
594
557
  */
595
- (selector: string, config?: ConfigWithPlugins): WithOpts<PluginPlayer, ConfigWithPlugins>;
558
+ (selector: string, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
596
559
  /**
597
560
  * Configure flowplayer, it's attached plugins and display flowplayer it in the UI
598
561
  * @param element - HTML element where player will render
599
562
  * @param config - Configuration of the flowplayer and the attached plugins
600
563
  */
601
- (element: HTMLElement, config?: ConfigWithPlugins): WithOpts<PluginPlayer, ConfigWithPlugins>;
564
+ (element: HTMLElement, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
602
565
  }
603
566
 
604
567
  /**
@@ -1217,6 +1180,11 @@ declare type PlayerState = FlowplayerStates[keyof FlowplayerStates];
1217
1180
  */
1218
1181
  declare type PlayerWith<T> = T & Player;
1219
1182
 
1183
+ declare type PlayerWithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = Omit<PluginPlayer, "opts" | "setOpts"> & {
1184
+ opts: PluginConfig;
1185
+ setOpts: (config: PluginConfig) => void;
1186
+ };
1187
+
1220
1188
  declare const PLAYING = "is-playing";
1221
1189
 
1222
1190
  /**
@@ -1545,7 +1513,6 @@ declare type SourceObj<T = unknown> = {
1545
1513
  * the MIME type (example `video/mp4` or `application/x-mpegurl`)
1546
1514
  */
1547
1515
  type?: string;
1548
- drm?: DRMSourceConfiguration;
1549
1516
  } & T;
1550
1517
 
1551
1518
  /**
@@ -1779,6 +1746,4 @@ declare const WILL_PLAY = "will-play";
1779
1746
 
1780
1747
  declare const WILL_SEEK = "will-seek";
1781
1748
 
1782
- declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = SetFieldType<SetFieldType<PluginPlayer, "opts", PluginConfig>, "setOpts", (config: PluginConfig) => void>;
1783
-
1784
1749
  export { }