@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/ga4.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 */
|
|
@@ -262,41 +260,6 @@ declare const DESTROYED = "is-destroyed";
|
|
|
262
260
|
|
|
263
261
|
declare const DISABLED = "is-disabled";
|
|
264
262
|
|
|
265
|
-
/**
|
|
266
|
-
* @public
|
|
267
|
-
*/
|
|
268
|
-
declare type DRM_KEYSYSTEM = "com.widevine.alpha" | "com.microsoft.playready" | "org.w3.clearkey" | "com.apple.fps.1_0";
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* @public
|
|
272
|
-
*/
|
|
273
|
-
declare type DRMConfiguration = {
|
|
274
|
-
license_server: string;
|
|
275
|
-
http_headers?: Record<string, string>;
|
|
276
|
-
certificate?: string;
|
|
277
|
-
vendor?: string | DRMVendorImplementation;
|
|
278
|
-
request_media_key_system_access_function?: MediaKeyFunc;
|
|
279
|
-
query_params?: Record<string, string>;
|
|
280
|
-
};
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* @public
|
|
284
|
-
*/
|
|
285
|
-
declare type DRMSourceConfiguration = {
|
|
286
|
-
[keysystem in DRM_KEYSYSTEM]?: DRMConfiguration;
|
|
287
|
-
};
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* @public
|
|
291
|
-
*/
|
|
292
|
-
declare type DRMVendorImplementation = {
|
|
293
|
-
fairplay_fetch_certificate: (url: string, cb: (certificate_data: Uint8Array) => void) => void;
|
|
294
|
-
fairplay_request_license: (url: string, params: {
|
|
295
|
-
message: any;
|
|
296
|
-
assetId: string;
|
|
297
|
-
}, cb: (license_data: Uint8Array) => void) => void;
|
|
298
|
-
};
|
|
299
|
-
|
|
300
263
|
/**
|
|
301
264
|
* @public
|
|
302
265
|
*/
|
|
@@ -523,13 +486,13 @@ declare interface FlowplayerUMDWithPlugins<ConfigWithPlugins extends Config = Co
|
|
|
523
486
|
* @param selector - query selector of the HTML element where player will render
|
|
524
487
|
* @param config - Configuration of the flowplayer and the attached plugins
|
|
525
488
|
*/
|
|
526
|
-
(selector: string, config?: ConfigWithPlugins):
|
|
489
|
+
(selector: string, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
|
|
527
490
|
/**
|
|
528
491
|
* Configure flowplayer, it's attached plugins and display flowplayer it in the UI
|
|
529
492
|
* @param element - HTML element where player will render
|
|
530
493
|
* @param config - Configuration of the flowplayer and the attached plugins
|
|
531
494
|
*/
|
|
532
|
-
(element: HTMLElement, config?: ConfigWithPlugins):
|
|
495
|
+
(element: HTMLElement, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
|
|
533
496
|
}
|
|
534
497
|
|
|
535
498
|
/**
|
|
@@ -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
|
/**
|
|
@@ -1182,6 +1150,7 @@ declare interface Plugin_2<PluginConfig extends Config = Config, PluginPlayer ex
|
|
|
1182
1150
|
*/
|
|
1183
1151
|
declare interface PluginCtor<PluginConfig extends Config = Config, PluginPlayer extends Player = Player> {
|
|
1184
1152
|
new (umd: FlowplayerUMD, player: Player): Plugin_2<PluginConfig, PluginPlayer>;
|
|
1153
|
+
pluginName: string;
|
|
1185
1154
|
}
|
|
1186
1155
|
|
|
1187
1156
|
/* Excluded from this release type: PluginRegisteredEventDetail */
|
|
@@ -1480,7 +1449,6 @@ declare type SourceObj<T = unknown> = {
|
|
|
1480
1449
|
* the MIME type (example `video/mp4` or `application/x-mpegurl`)
|
|
1481
1450
|
*/
|
|
1482
1451
|
type?: string;
|
|
1483
|
-
drm?: DRMSourceConfiguration;
|
|
1484
1452
|
} & T;
|
|
1485
1453
|
|
|
1486
1454
|
/**
|
|
@@ -1704,6 +1672,4 @@ declare const WILL_PLAY = "will-play";
|
|
|
1704
1672
|
|
|
1705
1673
|
declare const WILL_SEEK = "will-seek";
|
|
1706
1674
|
|
|
1707
|
-
declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = SetFieldType<SetFieldType<PluginPlayer, "opts", PluginConfig>, "setOpts", (config: PluginConfig) => void>;
|
|
1708
|
-
|
|
1709
1675
|
export { }
|
package/plugins/ga4.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.ga4=t())}(this,(function(){"use strict";
|
|
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.ga4=t())}(this,(function(){"use strict";var e;const t=((e=class GoogleAnalytics4Plugin{constructor(e){this.muted=!1,this.quartiles=[0,0,0],this.ad_type="preroll",this.preroll_counter=0,this.midroll_counter=0,this.postroll_counter=0,this.event_categories={live:"Live",videos:"Videos"},this.event_actions={fullscreen_enter:"fullscreen_enter",fullscreen_exit:"fullscreen_exit",video_player_load:"video_player_load",video_start:"video_start",video_click_play:"video_click_play",video_pause:"video_pause",video_resume:"video_resume",video_seeking:"video_seeking",video_ratechange:"video_ratechange",video_qualitychange:"video_qualitychange",video_mute:"video_mute",video_unmute:"video_unmute",video_25_percent:"video_25_percent",video_50_percent:"video_50_percent",video_75_percent:"video_75_percent",video_complete:"video_complete",live_start:"live_start",live_click_play:"live_click_play",live_pause:"live_pause",live_resume:"live_resume",live_ratechange:"live_ratechange",live_seeking:"live_seeking",live_qualitychange:"live_qualitychange",live_mute:"live_mute",live_unmute:"live_unmute",live_complete:"live_complete",ad_start_preroll:"ad_start_preroll",ad_start_midroll:"ad_start_midroll",ad_start_postroll:"ad_start_postroll",ad_completed_preroll:"ad_completed_preroll",ad_completed_midroll:"ad_completed_midroll",ad_completed_postroll:"ad_completed_postroll",ad_skipped_preroll:"ad_skipped_preroll",ad_skipped_midroll:"ad_skipped_midroll",ad_skipped_postroll:"ad_skipped_postroll",ad_break_completed:"ad_break_completed"},this.flowplayer=e}init(e,t,i){this.config=e,this.video=i,this.muted=i.muted,i.on(["mount","timeupdate","play","ended","pause","playing","volumechange","ad-started","ad-completed","ad-skipped","ad-break-completed","config","play","fullscreenenter","fullscreenexit","seeking","qualitychange","ratechange"],t=>{var a,s,o;switch(t.type){case"playing":this.track(e.live?this.event_actions.live_resume:this.event_actions.video_resume);break;case"pause":if(Math.abs(i.duration-i.currentTime)<1)break;this.track(e.live?this.event_actions.live_pause:this.event_actions.video_pause);break;case"seeking":this.track(e.live?this.event_actions.live_seeking:this.event_actions.video_seeking);break;case"ratechange":this.track(e.live?this.event_actions.live_ratechange:this.event_actions.video_ratechange,{playbackRate:null===(a=this.video)||void 0===a?void 0:a.playbackRate});break;case"qualitychange":{const i=t.detail;this.track(e.live?this.event_actions.live_qualitychange:this.event_actions.video_qualitychange,{before:null===(s=i.before)||void 0===s?void 0:s.height,after:null===(o=i.after)||void 0===o?void 0:o.height});break}case"play":i.hasState("is-starting")&&this.track(e.live?this.event_actions.live_start:this.event_actions.video_start),this.track(e.live?this.event_actions.live_click_play:this.event_actions.video_click_play);break;case"mount":this.track(this.event_actions.video_player_load);break;case"timeupdate":this.progress(i);break;case"ended":setTimeout(()=>{t.defaultPrevented||(this.track(e.live?this.event_actions.live_complete:this.event_actions.video_complete),this.reset())});break;case"volumechange":this.volumechange(i);break;case"ad-started":this.adstarted(t);break;case"ad-completed":this.adcompleted(t);break;case"ad-break-completed":this.adbreakcompleted();break;case"config":this.configured(t.detail);break;case"fullscreenenter":this.track(this.event_actions.fullscreen_enter);break;case"fullscreenexit":this.track(this.event_actions.fullscreen_exit);break;case"ad-skipped":this.adskipped()}})}progress(e){e.opts.live||(e.currentTime/e.duration>.25&&0===this.quartiles[0]?(this.quartiles[0]=1,this.track(this.event_actions.video_25_percent)):e.currentTime/e.duration>.5&&0===this.quartiles[1]?(this.quartiles[1]=1,this.track(this.event_actions.video_50_percent)):e.currentTime/e.duration>.75&&0===this.quartiles[2]&&(this.quartiles[2]=1,this.track(this.event_actions.video_75_percent)))}volumechange(e){this.muted!==e.muted&&(this.muted=e.muted,e.muted?this.track(e.opts.live?this.event_actions.live_mute:this.event_actions.video_mute):this.track(e.opts.live?this.event_actions.live_unmute:this.event_actions.video_unmute))}reset(){this.quartiles=[0,0,0],this.preroll_counter=0,this.midroll_counter=0,this.postroll_counter=0}configured(e){var t,i;(null===(t=null==e?void 0:e.ga)||void 0===t?void 0:t.event_actions)&&(this.event_actions=e.ga.event_actions),(null===(i=null==e?void 0:e.ga)||void 0===i?void 0:i.event_categories)&&(this.event_categories=e.ga.event_categories)}checkForAdCounter(e,t){return e.replace("[x]",t+"")}adstarted(e){var t;switch((null===(t=e.data)||void 0===t?void 0:t.ad_type)||"preroll"){case"midroll":this.ad_type="midroll",this.midroll_counter++,this.track(this.checkForAdCounter(this.event_actions.ad_start_midroll,this.midroll_counter));break;case"postroll":this.ad_type="postroll",this.postroll_counter++,this.track(this.checkForAdCounter(this.event_actions.ad_start_postroll,this.postroll_counter));break;default:this.ad_type="preroll",this.preroll_counter++,this.track(this.checkForAdCounter(this.event_actions.ad_start_preroll,this.preroll_counter))}}adcompleted(e){var t;switch((null===(t=e.data)||void 0===t?void 0:t.ad_type)||"preroll"){case"midroll":this.track(this.event_actions.ad_completed_midroll);break;case"postroll":this.track(this.event_actions.ad_completed_postroll);break;default:this.track(this.event_actions.ad_completed_preroll)}}adskipped(){if(this.ad_type)switch(this.ad_type){case"midroll":this.track(this.event_actions.ad_skipped_midroll);break;case"postroll":this.track(this.event_actions.ad_skipped_postroll);break;default:this.track(this.event_actions.ad_skipped_preroll)}else this.track(this.event_actions.ad_skipped_preroll)}adbreakcompleted(){this.track(this.event_actions.ad_break_completed)}pushToDataLayer(e,t,i,a){var s,o;if(window.dataLayer)try{window.dataLayer.push(Object.assign(Object.assign({event:"flowplayer",event_action:e,event_label:i,event_category:t,duration:null===(s=this.video)||void 0===s?void 0:s.duration},null===(o=null==this?void 0:this.config)||void 0===o?void 0:o.ga.custom_data),a))}catch(e){console.error(e)}}track(e,t){var i,a,s,o,l,r,n,d;if(!this.config||!this.config.ga||(null===(i=null==this?void 0:this.video)||void 0===i?void 0:i.hasState("consent-no-tracking")))return;const c=(null===(a=this.video)||void 0===a?void 0:a.opts.live)?this.event_categories.live:this.event_categories.videos,_=null===(s=this.config.ga)||void 0===s?void 0:s.ga_instances,v=(null===(o=null==this?void 0:this.config)||void 0===o?void 0:o.title)||(null===(l=this.config.metadata)||void 0===l?void 0:l.title)||"unknown video";if(!window.gtag||(null===(n=null===(r=this.config)||void 0===r?void 0:r.ga)||void 0===n?void 0:n.data_layer_tracking)||!_||!_.length)return this.pushToDataLayer(e,c,v,t);gtag("event",e,Object.assign(Object.assign({send_to:_,event_category:c,event_label:v,duration:null===(d=this.video)||void 0===d?void 0:d.duration},this.config.ga.custom_data),t))}}).pluginName="ga4",e);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 i=e.flowplayer;return"function"==typeof i?(i(t),t):(Array.isArray(i.extensions)||(i.extensions=[]),~i.extensions.indexOf(t)||i.extensions.push(t),t)}(window,t)}));
|
package/plugins/gemius.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 */
|
|
@@ -262,41 +260,6 @@ declare const DESTROYED = "is-destroyed";
|
|
|
262
260
|
|
|
263
261
|
declare const DISABLED = "is-disabled";
|
|
264
262
|
|
|
265
|
-
/**
|
|
266
|
-
* @public
|
|
267
|
-
*/
|
|
268
|
-
declare type DRM_KEYSYSTEM = "com.widevine.alpha" | "com.microsoft.playready" | "org.w3.clearkey" | "com.apple.fps.1_0";
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* @public
|
|
272
|
-
*/
|
|
273
|
-
declare type DRMConfiguration = {
|
|
274
|
-
license_server: string;
|
|
275
|
-
http_headers?: Record<string, string>;
|
|
276
|
-
certificate?: string;
|
|
277
|
-
vendor?: string | DRMVendorImplementation;
|
|
278
|
-
request_media_key_system_access_function?: MediaKeyFunc;
|
|
279
|
-
query_params?: Record<string, string>;
|
|
280
|
-
};
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* @public
|
|
284
|
-
*/
|
|
285
|
-
declare type DRMSourceConfiguration = {
|
|
286
|
-
[keysystem in DRM_KEYSYSTEM]?: DRMConfiguration;
|
|
287
|
-
};
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* @public
|
|
291
|
-
*/
|
|
292
|
-
declare type DRMVendorImplementation = {
|
|
293
|
-
fairplay_fetch_certificate: (url: string, cb: (certificate_data: Uint8Array) => void) => void;
|
|
294
|
-
fairplay_request_license: (url: string, params: {
|
|
295
|
-
message: any;
|
|
296
|
-
assetId: string;
|
|
297
|
-
}, cb: (license_data: Uint8Array) => void) => void;
|
|
298
|
-
};
|
|
299
|
-
|
|
300
263
|
/**
|
|
301
264
|
* @public
|
|
302
265
|
*/
|
|
@@ -523,13 +486,13 @@ declare interface FlowplayerUMDWithPlugins<ConfigWithPlugins extends Config = Co
|
|
|
523
486
|
* @param selector - query selector of the HTML element where player will render
|
|
524
487
|
* @param config - Configuration of the flowplayer and the attached plugins
|
|
525
488
|
*/
|
|
526
|
-
(selector: string, config?: ConfigWithPlugins):
|
|
489
|
+
(selector: string, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
|
|
527
490
|
/**
|
|
528
491
|
* Configure flowplayer, it's attached plugins and display flowplayer it in the UI
|
|
529
492
|
* @param element - HTML element where player will render
|
|
530
493
|
* @param config - Configuration of the flowplayer and the attached plugins
|
|
531
494
|
*/
|
|
532
|
-
(element: HTMLElement, config?: ConfigWithPlugins):
|
|
495
|
+
(element: HTMLElement, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
|
|
533
496
|
}
|
|
534
497
|
|
|
535
498
|
/**
|
|
@@ -1177,6 +1140,11 @@ declare type PlayerState = FlowplayerStates[keyof FlowplayerStates];
|
|
|
1177
1140
|
*/
|
|
1178
1141
|
declare type PlayerWith<T> = T & Player;
|
|
1179
1142
|
|
|
1143
|
+
declare type PlayerWithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = Omit<PluginPlayer, "opts" | "setOpts"> & {
|
|
1144
|
+
opts: PluginConfig;
|
|
1145
|
+
setOpts: (config: PluginConfig) => void;
|
|
1146
|
+
};
|
|
1147
|
+
|
|
1180
1148
|
declare const PLAYING = "is-playing";
|
|
1181
1149
|
|
|
1182
1150
|
/**
|
|
@@ -1207,6 +1175,7 @@ declare interface Plugin_2<PluginConfig extends Config = Config, PluginPlayer ex
|
|
|
1207
1175
|
*/
|
|
1208
1176
|
declare interface PluginCtor<PluginConfig extends Config = Config, PluginPlayer extends Player = Player> {
|
|
1209
1177
|
new (umd: FlowplayerUMD, player: Player): Plugin_2<PluginConfig, PluginPlayer>;
|
|
1178
|
+
pluginName: string;
|
|
1210
1179
|
}
|
|
1211
1180
|
|
|
1212
1181
|
/* Excluded from this release type: PluginRegisteredEventDetail */
|
|
@@ -1505,7 +1474,6 @@ declare type SourceObj<T = unknown> = {
|
|
|
1505
1474
|
* the MIME type (example `video/mp4` or `application/x-mpegurl`)
|
|
1506
1475
|
*/
|
|
1507
1476
|
type?: string;
|
|
1508
|
-
drm?: DRMSourceConfiguration;
|
|
1509
1477
|
} & T;
|
|
1510
1478
|
|
|
1511
1479
|
/**
|
|
@@ -1729,6 +1697,4 @@ declare const WILL_PLAY = "will-play";
|
|
|
1729
1697
|
|
|
1730
1698
|
declare const WILL_SEEK = "will-seek";
|
|
1731
1699
|
|
|
1732
|
-
declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = SetFieldType<SetFieldType<PluginPlayer, "opts", PluginConfig>, "setOpts", (config: PluginConfig) => void>;
|
|
1733
|
-
|
|
1734
1700
|
export { }
|
package/plugins/gemius.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(i,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):((i="undefined"!=typeof globalThis?globalThis:i||self).flowplayer=i.flowplayer||{},i.flowplayer.gemius=e())}(this,(function(){"use strict";function i(i,e,t){const r=function(i){return Array.isArray(i)?i.slice(0):i.split(".")}(e);for(;r.length;){if(null==i)return t;const e=r.shift();if("string"!=typeof e)return t;i=i[e]}return null==i?t:i}const
|
|
1
|
+
!function(i,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):((i="undefined"!=typeof globalThis?globalThis:i||self).flowplayer=i.flowplayer||{},i.flowplayer.gemius=e())}(this,(function(){"use strict";function i(i,e,t){const r=function(i){return Array.isArray(i)?i.slice(0):i.split(".")}(e);for(;r.length;){if(null==i)return t;const e=r.shift();if("string"!=typeof e)return t;i=i[e]}return null==i?t:i}var e;const t=["playerID","gemiusID"],r=["programID","additionalParameters.programName","additionalParameters.programType","additionalParameters.programDuration"],s=["adName","adDuration","adType","campaignClassification","quality","resolution","volume"];function a(e,t){const r=[];return t.forEach((function(t){void 0===i(e,t)&&r.push(t)})),r.length&&console.warn("Missing Gemius configuration: ",r.join(", ")),0===r.length}function n(i){return i<.5||isNaN(i)?0:Math.round(i)}const u=((e=class GemiusPlugin{constructor(i){this.started=!1,this.starting=!1,this.paused=!1,this.seeking=!1,this.buffering=!1,this.currentTime=0,this.flowplayer=i}init(i,e,t){if("function"!=typeof GemiusPlayer)return console.warn("Gemius SDK needs to be loaded prior loading gemius plugin");if(!i.gemius)return console.warn("Gemius plugin loaded but not configured");var r;t.hasState("consent-no-tracking")||(this.gemius=i.gemius,t.on("reap",()=>{this.gemiusPlayer&&this.gemius&&this.gemius.programID&&this.gemiusPlayer.programEvent(this.gemius.programID,n(t.currentTime),"stop"),this.gemiusPlayer=void 0,this.resetParams(),window.removeEventListener("beforeunload",this.handle_window_unload.bind(this,t))}),window.addEventListener("beforeunload",this.handle_window_unload.bind(this,t)),t.on(["config","loadedmetadata","src","loadstart"],e=>{var r,s;(null===(r=e.data)||void 0===r?void 0:r.gemius)&&(this.gemius=Object.assign(Object.assign({},this.gemius),null===(s=e.data)||void 0===s?void 0:s.gemius)),e.type===this.getInitEventType(i)&&this.initGemius(i,t)}),t.on("volumechange",()=>{var i;this.gemiusPlayer&&(null===(i=this.gemius)||void 0===i?void 0:i.programID)&&this.gemiusPlayer.programEvent(this.gemius.programID,n(t.currentTime),"chngVol",{volume:o(t.volume,t.muted)})}),t.on("resize",()=>{var i;this.gemiusPlayer&&(null===(i=this.gemius)||void 0===i?void 0:i.programID)&&(this.sendPlayWithRequiremets(t),this.gemiusPlayer.programEvent(this.gemius.programID,n(t.currentTime),"chngRes",{resolution:t.clientWidth+"x"+t.clientHeight}))}),t.on("play",()=>{this.buffering=!1,this.starting=!0,this.started?this.sendPlay(t):this.sendPlayWithRequiremets(t),this.paused=!1}),t.on("ended",(r=()=>{var i;this.started&&(this.resetParams(),this.gemiusPlayer&&(null===(i=this.gemius)||void 0===i?void 0:i.programID)&&this.gemiusPlayer.programEvent(this.gemius.programID,n(t.currentTime),"complete"))},i=>{setTimeout((function(){if(!i.defaultPrevented)return r(i)}),0)})),t.on("seeking",()=>{var i;this.started&&!this.seeking&&(this.seeking=!0,this.gemiusPlayer&&(null===(i=this.gemius)||void 0===i?void 0:i.programID)&&this.gemiusPlayer.programEvent(this.gemius.programID,this.currentTime,"seek"))}),t.on("seeked",()=>{var i;this.started&&!this.paused&&(this.seeking=!1,this.gemiusPlayer&&(null===(i=this.gemius)||void 0===i?void 0:i.programID)&&this.gemiusPlayer.programEvent(this.gemius.programID,n(t.currentTime),"play",{autoPlay:this.gemius.additionalParameters.autoPlay,volume:o(this.gemius.additionalParameters.volume||0)||0}))}),t.on("pause",()=>{var e;this.started&&t.currentTime>.25&&(i.live||i.duration&&i.duration-t.currentTime>.25)&&(this.paused=!0,this.gemiusPlayer&&(null===(e=this.gemius)||void 0===e?void 0:e.programID)&&this.gemiusPlayer.programEvent(this.gemius.programID,n(t.currentTime),"pause"))}),t.on("waiting",()=>{var i;!this.buffering&&t.currentTime>.5&&(this.buffering=!0,this.gemiusPlayer&&(null===(i=this.gemius)||void 0===i?void 0:i.programID)&&this.gemiusPlayer.programEvent(this.gemius.programID,n(t.currentTime),"buffer"))}),t.on("timeupdate",()=>{this.currentTime=Math.round(t.currentTime)}),t.on("ad-started",i=>{var e,t;const r=i.detail;var a;r&&(this.paused=!1,this.currentAd={id:r.vast_ad_id||"unknown id",duration:(null===(e=r.ad)||void 0===e?void 0:e.duration)||-1,currentTime:0},this.gemiusPlayer&&(null===(t=this.gemius)||void 0===t?void 0:t.programID)&&(this.gemiusPlayer.newAd(r.vast_ad_id,(a=Object.assign({},this.gemius.additionalParameters,function(i){var e,t,r;return{adDuration:null===(e=i.ad)||void 0===e?void 0:e.duration,adType:i.ad_type,resolution:(null===(t=i.ad)||void 0===t?void 0:t.width)+"x"+(null===(r=i.ad)||void 0===r?void 0:r.height),volume:o(i.volume)}}(r)),s.reduce((function(i,e){return a&&a.hasOwnProperty(e)&&(i[e]=a[e]),i}),{}))),this.gemiusPlayer.adEvent(this.gemius.programID,this.currentAd.id,0,"play",{autoPlay:this.gemius.additionalParameters.autoPlay,volume:o(r.volume)})))}),t.on("ad-paused",()=>{var i;this.paused=!0,this.currentAd&&this.gemiusPlayer&&(null===(i=this.gemius)||void 0===i?void 0:i.programID)&&this.gemiusPlayer.adEvent(this.gemius.programID,this.currentAd.id,this.currentAd.currentTime,"pause")}),t.on("ad-resumed",i=>{var e;const t=i.detail;if(t&&this.currentAd&&this.paused){if(this.paused=!1,!this.gemiusPlayer||!(null===(e=this.gemius)||void 0===e?void 0:e.programID))return;this.gemiusPlayer.adEvent(this.gemius.programID,this.currentAd.id,this.currentAd.currentTime,"play",{autoPlay:this.gemius.additionalParameters.autoPlay,volume:o(t.volume)})}}),t.on("ad-completed",()=>{var i;if(this.currentAd){if(!this.gemiusPlayer||!(null===(i=this.gemius)||void 0===i?void 0:i.programID))return;this.gemiusPlayer.adEvent(this.gemius.programID,this.currentAd.id,this.currentAd.duration,"complete"),this.currentAd=void 0}}),t.on("ad-progress",i=>{const e=i.detail;e&&this.currentAd&&(this.currentAd.currentTime=Math.round(e.duration-e.remaining)||0)}),t.on("ad-volume-changed",i=>{var e;const t=i.detail;if("number"==typeof t&&this.currentAd){const i=t||-1;if(!this.gemiusPlayer||!(null===(e=this.gemius)||void 0===e?void 0:e.programID))return;this.gemiusPlayer.adEvent(this.gemius.programID,this.currentAd.id,this.currentAd.duration,"chngVol",{volume:o(i)})}}))}resetParams(){this.seeking=!1,this.starting=!1,this.started=!1,this.paused=!1,this.buffering=!1,this.currentAd=void 0,this.currentTime=0}sendPlay(i){var e;this.gemiusPlayer&&(null===(e=this.gemius)||void 0===e?void 0:e.programID)&&(this.started=!0,this.gemiusPlayer.programEvent(this.gemius.programID,n(i.currentTime),"play",{autoPlay:this.gemius.additionalParameters.autoPlay,volume:o(this.gemius.additionalParameters.volume||0)}))}sendPlayWithRequiremets(i){this.starting&&!this.started&&i.videoWidth>0&&this.sendPlay(i)}getInitEventType(i){return!i.ima&&i.autoplay?"src":"loadstart"}initGemius(e,s){if(!a(i(e,"gemius",{}),t))return;if(!this.gemius)return;const n={currentDomain:this.gemius.additionalParameters.currentDomain,volume:o(this.gemius.additionalParameters.volume||0)};if(this.gemiusPlayer&&(this.gemiusPlayer=void 0),this.gemiusPlayer=new GemiusPlayer(this.gemius.playerID,this.gemius.gemiusID,n),this.gemiusPlayer.setVideoObject(s),!a(this.gemius,r))return;const u={programName:this.gemius.additionalParameters.programName,programDuration:this.gemius.additionalParameters.programDuration,programType:this.gemius.additionalParameters.programType,volume:o(this.gemius.additionalParameters.volume||0)};this.gemiusPlayer.newProgram(this.gemius.programID,u),this.sendPlayWithRequiremets(s)}handle_window_unload(i){var e;this.gemiusPlayer&&(null===(e=this.gemius)||void 0===e?void 0:e.programID)&&this.gemiusPlayer.programEvent(this.gemius.programID,n(i.currentTime),"close"),this.resetParams()}}).pluginName="gemius",e);function o(i,e){return-1===i||e?-1:Math.max(0,Math.min(100,Math.round(100*i)))}return function(i,e){if("object"==typeof exports&&"undefined"!=typeof module)return e;if(null===document.currentScript)return e;"flowplayer"in i||(i.flowplayer={extensions:[]});const t=i.flowplayer;return"function"==typeof t?(t(e),e):(Array.isArray(t.extensions)||(t.extensions=[]),~t.extensions.indexOf(e)||t.extensions.push(e),e)}(window,u)}));
|
|
@@ -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 */
|
|
@@ -262,41 +260,6 @@ declare const DESTROYED = "is-destroyed";
|
|
|
262
260
|
|
|
263
261
|
declare const DISABLED = "is-disabled";
|
|
264
262
|
|
|
265
|
-
/**
|
|
266
|
-
* @public
|
|
267
|
-
*/
|
|
268
|
-
declare type DRM_KEYSYSTEM = "com.widevine.alpha" | "com.microsoft.playready" | "org.w3.clearkey" | "com.apple.fps.1_0";
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* @public
|
|
272
|
-
*/
|
|
273
|
-
declare type DRMConfiguration = {
|
|
274
|
-
license_server: string;
|
|
275
|
-
http_headers?: Record<string, string>;
|
|
276
|
-
certificate?: string;
|
|
277
|
-
vendor?: string | DRMVendorImplementation;
|
|
278
|
-
request_media_key_system_access_function?: MediaKeyFunc;
|
|
279
|
-
query_params?: Record<string, string>;
|
|
280
|
-
};
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* @public
|
|
284
|
-
*/
|
|
285
|
-
declare type DRMSourceConfiguration = {
|
|
286
|
-
[keysystem in DRM_KEYSYSTEM]?: DRMConfiguration;
|
|
287
|
-
};
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* @public
|
|
291
|
-
*/
|
|
292
|
-
declare type DRMVendorImplementation = {
|
|
293
|
-
fairplay_fetch_certificate: (url: string, cb: (certificate_data: Uint8Array) => void) => void;
|
|
294
|
-
fairplay_request_license: (url: string, params: {
|
|
295
|
-
message: any;
|
|
296
|
-
assetId: string;
|
|
297
|
-
}, cb: (license_data: Uint8Array) => void) => void;
|
|
298
|
-
};
|
|
299
|
-
|
|
300
263
|
/**
|
|
301
264
|
* @public
|
|
302
265
|
*/
|
|
@@ -523,13 +486,13 @@ declare interface FlowplayerUMDWithPlugins<ConfigWithPlugins extends Config = Co
|
|
|
523
486
|
* @param selector - query selector of the HTML element where player will render
|
|
524
487
|
* @param config - Configuration of the flowplayer and the attached plugins
|
|
525
488
|
*/
|
|
526
|
-
(selector: string, config?: ConfigWithPlugins):
|
|
489
|
+
(selector: string, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
|
|
527
490
|
/**
|
|
528
491
|
* Configure flowplayer, it's attached plugins and display flowplayer it in the UI
|
|
529
492
|
* @param element - HTML element where player will render
|
|
530
493
|
* @param config - Configuration of the flowplayer and the attached plugins
|
|
531
494
|
*/
|
|
532
|
-
(element: HTMLElement, config?: ConfigWithPlugins):
|
|
495
|
+
(element: HTMLElement, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
|
|
533
496
|
}
|
|
534
497
|
|
|
535
498
|
/**
|
|
@@ -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
|
/**
|
|
@@ -1182,6 +1150,7 @@ declare interface Plugin_2<PluginConfig extends Config = Config, PluginPlayer ex
|
|
|
1182
1150
|
*/
|
|
1183
1151
|
declare interface PluginCtor<PluginConfig extends Config = Config, PluginPlayer extends Player = Player> {
|
|
1184
1152
|
new (umd: FlowplayerUMD, player: Player): Plugin_2<PluginConfig, PluginPlayer>;
|
|
1153
|
+
pluginName: string;
|
|
1185
1154
|
}
|
|
1186
1155
|
|
|
1187
1156
|
/* Excluded from this release type: PluginRegisteredEventDetail */
|
|
@@ -1480,7 +1449,6 @@ declare type SourceObj<T = unknown> = {
|
|
|
1480
1449
|
* the MIME type (example `video/mp4` or `application/x-mpegurl`)
|
|
1481
1450
|
*/
|
|
1482
1451
|
type?: string;
|
|
1483
|
-
drm?: DRMSourceConfiguration;
|
|
1484
1452
|
} & T;
|
|
1485
1453
|
|
|
1486
1454
|
/**
|
|
@@ -1704,6 +1672,4 @@ declare const WILL_PLAY = "will-play";
|
|
|
1704
1672
|
|
|
1705
1673
|
declare const WILL_SEEK = "will-seek";
|
|
1706
1674
|
|
|
1707
|
-
declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = SetFieldType<SetFieldType<PluginPlayer, "opts", PluginConfig>, "setOpts", (config: PluginConfig) => void>;
|
|
1708
|
-
|
|
1709
1675
|
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.google_analytics=t())}(this,(function(){"use strict";
|
|
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.google_analytics=t())}(this,(function(){"use strict";var e;const t=((e=class GoogleAnalyticsPlugin{constructor(e){this.muted=!1,this.ga_extensions=[],this.quartiles=[0,0,0],this.ad_type="preroll",this.preroll_counter=0,this.midroll_counter=0,this.postroll_counter=0,this.event_categories={live:"Live",videos:"Videos"},this.event_actions={fullscreen_enter:"fullscreen_enter",fullscreen_exit:"fullscreen_exit",video_player_load:"video_player_load",video_start:"video_start",video_click_play:"video_click_play",video_pause:"video_pause",video_resume:"video_resume",video_seeking:"video_seeking",video_ratechange:"video_ratechange",video_qualitychange:"video_qualitychange",video_mute:"video_mute",video_unmute:"video_unmute",video_25_percent:"video_25_percent",video_50_percent:"video_50_percent",video_75_percent:"video_75_percent",video_complete:"video_complete",live_start:"live_start",live_click_play:"live_click_play",live_pause:"live_pause",live_resume:"live_resume",live_ratechange:"live_ratechange",live_seeking:"live_seeking",live_qualitychange:"live_qualitychange",live_mute:"live_mute",live_unmute:"live_unmute",live_complete:"live_complete",ad_start_preroll:"ad_start_preroll",ad_start_midroll:"ad_start_midroll",ad_start_postroll:"ad_start_postroll",ad_completed_preroll:"ad_completed_preroll",ad_completed_midroll:"ad_completed_midroll",ad_completed_postroll:"ad_completed_postroll",ad_skipped_preroll:"ad_skipped_preroll",ad_skipped_midroll:"ad_skipped_midroll",ad_skipped_postroll:"ad_skipped_postroll",ad_break_completed:"ad_break_completed"},console.warn("universal analytics by Google has been sunset, please use the ga4 plugin"),this.flowplayer=e}init(e,t,i){this.config=e,this.video=i,this.muted=i.muted,i.on(["mount","timeupdate","play","ended","pause","playing","volumechange","ad-started","ad-completed","ad-skipped","ad-break-completed","config","play","fullscreenenter","fullscreenexit"],t=>{switch(t.type){case"playing":this.track(e.live?this.event_actions.live_resume:this.event_actions.video_resume);break;case"pause":if(Math.abs(i.duration-i.currentTime)<1)break;this.track(e.live?this.event_actions.live_pause:this.event_actions.video_pause);break;case"play":i.hasState("is-starting")&&this.track(e.live?this.event_actions.live_start:this.event_actions.video_start),this.track(e.live?this.event_actions.live_click_play:this.event_actions.video_click_play);break;case"mount":this.track(this.event_actions.video_player_load);break;case"timeupdate":this.progress(i);break;case"ended":setTimeout(()=>{this.track(e.live?this.event_actions.live_complete:this.event_actions.video_complete),this.reset()},0);break;case"volumechange":this.volumechange(i);break;case"ad-started":this.adstarted(t);break;case"ad-completed":this.adcompleted(t);break;case"ad-break-completed":this.adbreakcompleted();break;case"config":this.configured(t.detail);break;case"fullscreenenter":this.track(this.event_actions.fullscreen_enter);break;case"fullscreenexit":this.track(this.event_actions.fullscreen_exit);break;case"ad-skipped":this.adskipped()}})}setup_ga(e){window.ga&&!this.ga_extensions.length&&e.forEach((e,t)=>{var i;window.ga("create",e,"auto","ext"+(t+1)),(null===(i=this.config)||void 0===i?void 0:i.ga.custom_data)&&window.ga("ext"+(t+1)+".set",this.config.ga.custom_data),this.ga_extensions.push("ext"+(t+1))})}progress(e){e.opts.live||(e.currentTime/e.duration>.25&&0===this.quartiles[0]?(this.quartiles[0]=1,this.track(this.event_actions.video_25_percent)):e.currentTime/e.duration>.5&&0===this.quartiles[1]?(this.quartiles[1]=1,this.track(this.event_actions.video_50_percent)):e.currentTime/e.duration>.75&&0===this.quartiles[2]&&(this.quartiles[2]=1,this.track(this.event_actions.video_75_percent)))}volumechange(e){this.muted!==e.muted&&(this.muted=e.muted,e.muted?this.track(e.opts.live?this.event_actions.live_mute:this.event_actions.video_mute):this.track(e.opts.live?this.event_actions.live_unmute:this.event_actions.video_unmute))}reset(){this.quartiles=[0,0,0],this.preroll_counter=0,this.midroll_counter=0,this.postroll_counter=0}configured(e){var t,i;(null===(t=null==e?void 0:e.ga)||void 0===t?void 0:t.event_actions)&&(this.event_actions=e.ga.event_actions),(null===(i=null==e?void 0:e.ga)||void 0===i?void 0:i.event_categories)&&(this.event_categories=e.ga.event_categories)}checkForAdCounter(e,t){return e.replace("[x]",t+"")}adstarted(e){var t;switch((null===(t=e.data)||void 0===t?void 0:t.ad_type)||"preroll"){case"midroll":this.ad_type="midroll",this.midroll_counter++,this.track(this.checkForAdCounter(this.event_actions.ad_start_midroll,this.midroll_counter));break;case"postroll":this.ad_type="postroll",this.postroll_counter++,this.track(this.checkForAdCounter(this.event_actions.ad_start_postroll,this.postroll_counter));break;default:this.ad_type="preroll",this.preroll_counter++,this.track(this.checkForAdCounter(this.event_actions.ad_start_preroll,this.preroll_counter))}}adcompleted(e){var t;switch((null===(t=e.data)||void 0===t?void 0:t.ad_type)||"preroll"){case"midroll":this.track(this.event_actions.ad_completed_midroll);break;case"postroll":this.track(this.event_actions.ad_completed_postroll);break;default:this.track(this.event_actions.ad_completed_preroll)}}adskipped(){if(this.ad_type)switch(this.ad_type){case"midroll":this.track(this.event_actions.ad_skipped_midroll);break;case"postroll":this.track(this.event_actions.ad_skipped_postroll);break;default:this.track(this.event_actions.ad_skipped_preroll)}else this.track(this.event_actions.ad_skipped_preroll)}adbreakcompleted(){this.track(this.event_actions.ad_break_completed)}pushToDataLayer(e,t,i){var s;if(window.dataLayer)try{window.dataLayer.push({event:"Flowplayer",video_name:i,action:e,category:t,duration:null===(s=this.video)||void 0===s?void 0:s.duration})}catch(e){}}track(e){var t,i,s,a,o;if(!this.config||!this.config.ga||!e||(null===(t=null==this?void 0:this.video)||void 0===t?void 0:t.hasState("consent-no-tracking")))return;const l=(null===(i=this.video)||void 0===i?void 0:i.opts.live)?this.event_categories.live:this.event_categories.videos,r=null===(s=this.config.ga)||void 0===s?void 0:s.ga_instances,n=(null===(a=null==this?void 0:this.config)||void 0===a?void 0:a.title)||(null===(o=this.config.metadata)||void 0===o?void 0:o.title)||"unknown video";return this.config.ga.data_layer_tracking?this.pushToDataLayer(e,l,n):(this.setup_ga(r),this.ga_extensions.length&&void 0!==window.ga&&null!==window.ga?void this.ga_extensions.forEach(t=>{window.ga(t+".send","event",l,e,n)}):console.debug("ga console.send","event",l,e,n))}}).pluginName="ga",e);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 i=e.flowplayer;return"function"==typeof i?(i(t),t):(Array.isArray(i.extensions)||(i.extensions=[]),~i.extensions.indexOf(t)||i.extensions.push(t),t)}(window,t)}));
|
package/plugins/hls.d.ts
CHANGED
|
@@ -5,8 +5,6 @@ import type { Get } from 'type-fest';
|
|
|
5
5
|
import Hls from 'hls.js';
|
|
6
6
|
import type { HlsConfig } from 'hls.js';
|
|
7
7
|
import type { Level } 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 */
|
|
@@ -266,41 +264,6 @@ declare const DESTROYED = "is-destroyed";
|
|
|
266
264
|
|
|
267
265
|
declare const DISABLED = "is-disabled";
|
|
268
266
|
|
|
269
|
-
/**
|
|
270
|
-
* @public
|
|
271
|
-
*/
|
|
272
|
-
declare type DRM_KEYSYSTEM = "com.widevine.alpha" | "com.microsoft.playready" | "org.w3.clearkey" | "com.apple.fps.1_0";
|
|
273
|
-
|
|
274
|
-
/**
|
|
275
|
-
* @public
|
|
276
|
-
*/
|
|
277
|
-
declare type DRMConfiguration = {
|
|
278
|
-
license_server: string;
|
|
279
|
-
http_headers?: Record<string, string>;
|
|
280
|
-
certificate?: string;
|
|
281
|
-
vendor?: string | DRMVendorImplementation;
|
|
282
|
-
request_media_key_system_access_function?: MediaKeyFunc;
|
|
283
|
-
query_params?: Record<string, string>;
|
|
284
|
-
};
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* @public
|
|
288
|
-
*/
|
|
289
|
-
declare type DRMSourceConfiguration = {
|
|
290
|
-
[keysystem in DRM_KEYSYSTEM]?: DRMConfiguration;
|
|
291
|
-
};
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* @public
|
|
295
|
-
*/
|
|
296
|
-
declare type DRMVendorImplementation = {
|
|
297
|
-
fairplay_fetch_certificate: (url: string, cb: (certificate_data: Uint8Array) => void) => void;
|
|
298
|
-
fairplay_request_license: (url: string, params: {
|
|
299
|
-
message: any;
|
|
300
|
-
assetId: string;
|
|
301
|
-
}, cb: (license_data: Uint8Array) => void) => void;
|
|
302
|
-
};
|
|
303
|
-
|
|
304
267
|
/**
|
|
305
268
|
* @public
|
|
306
269
|
*/
|
|
@@ -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):
|
|
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):
|
|
505
|
+
(element: HTMLElement, config?: ConfigWithPlugins): PlayerWithOpts<PluginPlayer, ConfigWithPlugins>;
|
|
543
506
|
}
|
|
544
507
|
|
|
545
508
|
/**
|
|
@@ -1207,6 +1170,11 @@ declare type PlayerState = FlowplayerStates[keyof FlowplayerStates];
|
|
|
1207
1170
|
*/
|
|
1208
1171
|
declare type PlayerWith<T> = T & Player;
|
|
1209
1172
|
|
|
1173
|
+
declare type PlayerWithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = Omit<PluginPlayer, "opts" | "setOpts"> & {
|
|
1174
|
+
opts: PluginConfig;
|
|
1175
|
+
setOpts: (config: PluginConfig) => void;
|
|
1176
|
+
};
|
|
1177
|
+
|
|
1210
1178
|
declare const PLAYING = "is-playing";
|
|
1211
1179
|
|
|
1212
1180
|
/**
|
|
@@ -1237,6 +1205,7 @@ declare interface Plugin_2<PluginConfig extends Config = Config, PluginPlayer ex
|
|
|
1237
1205
|
*/
|
|
1238
1206
|
declare interface PluginCtor<PluginConfig extends Config = Config, PluginPlayer extends Player = Player> {
|
|
1239
1207
|
new (umd: FlowplayerUMD, player: Player): Plugin_2<PluginConfig, PluginPlayer>;
|
|
1208
|
+
pluginName: string;
|
|
1240
1209
|
}
|
|
1241
1210
|
|
|
1242
1211
|
/* Excluded from this release type: PluginRegisteredEventDetail */
|
|
@@ -1540,7 +1509,6 @@ declare type SourceObj<T = unknown> = {
|
|
|
1540
1509
|
* the MIME type (example `video/mp4` or `application/x-mpegurl`)
|
|
1541
1510
|
*/
|
|
1542
1511
|
type?: string;
|
|
1543
|
-
drm?: DRMSourceConfiguration;
|
|
1544
1512
|
} & T;
|
|
1545
1513
|
|
|
1546
1514
|
/**
|
|
@@ -1764,6 +1732,4 @@ declare const WILL_PLAY = "will-play";
|
|
|
1764
1732
|
|
|
1765
1733
|
declare const WILL_SEEK = "will-seek";
|
|
1766
1734
|
|
|
1767
|
-
declare type WithOpts<PluginPlayer extends Player = Player, PluginConfig extends Config = Config> = SetFieldType<SetFieldType<PluginPlayer, "opts", PluginConfig>, "setOpts", (config: PluginConfig) => void>;
|
|
1768
|
-
|
|
1769
1735
|
export { }
|