@flowplayer/player 3.15.1-rc → 3.16.0-rc
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.d.ts +22 -2
- package/core/events.js +50 -50
- package/core.js +1 -1
- package/default.js +1 -1
- package/embed.js +2 -2
- package/flowplayer.css +1 -1
- package/index.d.ts +78 -35
- package/package.json +1 -1
- package/plugins/ads.d.ts +76 -33
- package/plugins/ads.js +1 -1
- package/plugins/airplay.d.ts +76 -33
- package/plugins/analytics.d.ts +76 -33
- package/plugins/analytics.js +1 -1
- package/plugins/asel.d.ts +221 -36
- package/plugins/asel.js +1 -1
- package/plugins/audio.d.ts +76 -33
- package/plugins/chapters.d.ts +76 -33
- package/plugins/chromecast.d.ts +76 -33
- package/plugins/chromecast.js +1 -1
- package/plugins/comscore.d.ts +76 -33
- package/plugins/consent.d.ts +76 -33
- package/plugins/context-menu.d.ts +76 -33
- package/plugins/cuepoints.d.ts +76 -33
- package/plugins/dash.d.ts +76 -33
- package/plugins/dash.js +1 -1
- package/plugins/drm.d.ts +76 -33
- package/plugins/endscreen.d.ts +76 -33
- package/plugins/fas.d.ts +76 -33
- package/plugins/float-on-scroll.d.ts +76 -33
- package/plugins/ga4.d.ts +76 -33
- package/plugins/gemius.d.ts +76 -33
- package/plugins/google-analytics.d.ts +76 -33
- package/plugins/health.d.ts +76 -33
- package/plugins/health.js +1 -1
- package/plugins/hls.d.ts +76 -33
- package/plugins/hls.js +1 -1
- package/plugins/id3.d.ts +76 -33
- package/plugins/iframe.d.ts +76 -33
- package/plugins/keyboard.d.ts +76 -33
- package/plugins/media-session.d.ts +76 -33
- package/plugins/message.d.ts +76 -33
- package/plugins/ovp.d.ts +76 -33
- package/plugins/playlist.d.ts +107 -33
- package/plugins/playlist.js +1 -1
- package/plugins/preview.d.ts +76 -33
- package/plugins/qsel.d.ts +76 -33
- package/plugins/qul.d.ts +76 -33
- package/plugins/rts.d.ts +76 -33
- package/plugins/share.d.ts +76 -33
- package/plugins/speed.d.ts +76 -33
- package/plugins/ssai.d.ts +76 -33
- package/plugins/ssai.js +1 -1
- package/plugins/subtitles.d.ts +76 -33
- package/plugins/thumbnails.d.ts +76 -33
- package/plugins/tizen.d.ts +76 -33
- package/plugins/vtsel.d.ts +76 -33
- package/plugins/webos.d.ts +76 -33
- package/util/loader.d.ts +76 -33
|
@@ -344,6 +344,7 @@ declare type ErrorEventDetail = {
|
|
|
344
344
|
declare namespace events {
|
|
345
345
|
export {
|
|
346
346
|
MOUNT,
|
|
347
|
+
RETRY,
|
|
347
348
|
ERROR,
|
|
348
349
|
CONTEXT_MENU,
|
|
349
350
|
CLICK,
|
|
@@ -395,7 +396,8 @@ declare namespace events {
|
|
|
395
396
|
LANDSCAPE,
|
|
396
397
|
PORTRAIT,
|
|
397
398
|
DVR,
|
|
398
|
-
|
|
399
|
+
LIVE,
|
|
400
|
+
RECOVER
|
|
399
401
|
}
|
|
400
402
|
}
|
|
401
403
|
|
|
@@ -600,8 +602,6 @@ declare const /**
|
|
|
600
602
|
*/
|
|
601
603
|
LANDSCAPE = "landscape";
|
|
602
604
|
|
|
603
|
-
declare const LIVE = "is-live";
|
|
604
|
-
|
|
605
605
|
/**
|
|
606
606
|
* @public
|
|
607
607
|
* when src is a livestream
|
|
@@ -613,7 +613,9 @@ declare const /**
|
|
|
613
613
|
* @public
|
|
614
614
|
* when src is a livestream
|
|
615
615
|
*/
|
|
616
|
-
|
|
616
|
+
LIVE = "live";
|
|
617
|
+
|
|
618
|
+
declare const LIVE_2 = "is-live";
|
|
617
619
|
|
|
618
620
|
declare const LIVE_SEEKED = "is-live-seeked";
|
|
619
621
|
|
|
@@ -913,33 +915,27 @@ declare type Player = HTMLVideoElement & PlayerEventOverloads & {
|
|
|
913
915
|
|
|
914
916
|
declare type PlayerCustomEventName = keyof PlayerCustomEventsDetailMap;
|
|
915
917
|
|
|
916
|
-
declare type PlayerCustomEventsDetailMap = {
|
|
917
|
-
[
|
|
918
|
-
[
|
|
919
|
-
[CONTEXT_MENU]: ContextMenuEventDetail;
|
|
920
|
-
/* Excluded from this release type: beforeplay */
|
|
921
|
-
/* Excluded from this release type: beforepause */
|
|
922
|
-
/* Excluded from this release type: state */
|
|
918
|
+
declare type PlayerCustomEventsDetailMap = PlayerEmittableCustomEventsDetailMap & {
|
|
919
|
+
[REAP]: ReapEventDetail;
|
|
920
|
+
[SOURCE]: SourceEventDetail;
|
|
923
921
|
[CUEPOINT_START]: CuePointStartEventDetail;
|
|
924
922
|
[CUEPOINT_END]: CuePointEndEventDetail;
|
|
925
|
-
[
|
|
926
|
-
[
|
|
927
|
-
[
|
|
928
|
-
|
|
929
|
-
[
|
|
930
|
-
/* Excluded from this release type: config */
|
|
931
|
-
[QUALITIES]: QualitiesEventDetail;
|
|
932
|
-
/* Excluded from this release type: "error:fatal" */
|
|
933
|
-
[RECOMMENDATIONS_READY]: RecommendationsReadyEventDetail;
|
|
923
|
+
[MOUNT]: MountEventDetail;
|
|
924
|
+
[LIVE]: LiveEventDetail;
|
|
925
|
+
[DVR]: DvrEventDetail;
|
|
926
|
+
[RETRY]: RetryEventDetail;
|
|
927
|
+
[RECOVER]: RecoverEventDetail;
|
|
934
928
|
/* Excluded from this release type: audioonlysource */
|
|
935
929
|
/* Excluded from this release type: renderplugin */
|
|
936
|
-
[DVR]: DvrEventDetail;
|
|
937
|
-
[LIVE_2]: LiveEventDetail;
|
|
938
930
|
/* Excluded from this release type: "seek:queued" */
|
|
939
931
|
/* Excluded from this release type: "seek:cancel" */
|
|
940
932
|
/* Excluded from this release type: "plugin:registered" */
|
|
941
933
|
/* Excluded from this release type: intersectionchange */
|
|
942
|
-
/* Excluded from this release type:
|
|
934
|
+
/* Excluded from this release type: beforeplay */
|
|
935
|
+
/* Excluded from this release type: beforepause */
|
|
936
|
+
/* Excluded from this release type: state */
|
|
937
|
+
/* Excluded from this release type: config */
|
|
938
|
+
/* Excluded from this release type: "error:fatal" */
|
|
943
939
|
};
|
|
944
940
|
|
|
945
941
|
declare type PlayerCustomEventsOverloads = {
|
|
@@ -978,11 +974,18 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
978
974
|
* Sent right before the player src attribute is set. This allows you to change the video URL before playback.
|
|
979
975
|
*/
|
|
980
976
|
on(event: typeof SOURCE, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof SOURCE]>) => void): Player;
|
|
981
|
-
|
|
977
|
+
/**
|
|
978
|
+
* Emitted when an Error recovery is attempted
|
|
979
|
+
*/
|
|
980
|
+
on(event: typeof RECOVER, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof RECOVER]>) => void): Player;
|
|
982
981
|
/**
|
|
983
982
|
* Sent when a flowplayer instance is about to be removed from the DOM, and any unsafe references are about to be reaped, which allows Single Page Applications to perform the necessary resource cleanups. This is important when working with front-end frameworks like React. This event should never be emitted directly, only listened to.
|
|
984
983
|
*/
|
|
985
984
|
on(event: typeof REAP, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof REAP]>) => void): Player;
|
|
985
|
+
/**
|
|
986
|
+
* Emitted when a player will retry to reload
|
|
987
|
+
*/
|
|
988
|
+
on(event: typeof RETRY, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof RETRY]>) => void): Player;
|
|
986
989
|
/* Excluded from this release type: on */
|
|
987
990
|
/**
|
|
988
991
|
* Emitted when the set of underlying qualities has changed.
|
|
@@ -1002,8 +1005,7 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1002
1005
|
/**
|
|
1003
1006
|
* when src is a livestream
|
|
1004
1007
|
*/
|
|
1005
|
-
on(event: typeof
|
|
1006
|
-
/* Excluded from this release type: on */
|
|
1008
|
+
on(event: typeof LIVE, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof LIVE]>) => void): Player;
|
|
1007
1009
|
/* Excluded from this release type: on */
|
|
1008
1010
|
/* Excluded from this release type: on */
|
|
1009
1011
|
/* Excluded from this release type: on */
|
|
@@ -1032,11 +1034,26 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1032
1034
|
*/
|
|
1033
1035
|
off<T>(event: string, handler: (e: FPEvent<T>) => void): Player;
|
|
1034
1036
|
/* Excluded from this release type: poll */
|
|
1035
|
-
emit<T extends PlayerCustomEventName>(event: T, data?: PlayerCustomEventsDetailMap[T]): Player;
|
|
1036
1037
|
/* Excluded from this release type: emit */
|
|
1037
|
-
|
|
1038
|
+
/* Excluded from this release type: emit */
|
|
1039
|
+
emit<T extends PlayerEmittableEventNames>(event: T, data?: PlayerCustomEventsDetailMap[T]): Player;
|
|
1040
|
+
/* Excluded from this release type: emit */
|
|
1041
|
+
};
|
|
1042
|
+
|
|
1043
|
+
declare type PlayerEmittableCustomEventsDetailMap = {
|
|
1044
|
+
[ERROR]: ErrorEventDetail;
|
|
1045
|
+
[CONTEXT_MENU]: ContextMenuEventDetail;
|
|
1046
|
+
[VIEW_ENTER]: ViewEnterEventDetail;
|
|
1047
|
+
[VIEW_LEAVE]: ViewLeaveEventDetail;
|
|
1048
|
+
[QUALITIES]: QualitiesEventDetail;
|
|
1049
|
+
[RECOMMENDATIONS_READY]: RecommendationsReadyEventDetail;
|
|
1038
1050
|
};
|
|
1039
1051
|
|
|
1052
|
+
declare type PlayerEmittableEventNames = keyof PlayerEmittableCustomEventsDetailMap;
|
|
1053
|
+
|
|
1054
|
+
/**
|
|
1055
|
+
* @public
|
|
1056
|
+
*/
|
|
1040
1057
|
declare type PlayerEventOverloads = PlayerNativeEventsOverloads & PlayerCustomEventsOverloads;
|
|
1041
1058
|
|
|
1042
1059
|
declare type PlayerNativeEventName = keyof PlayerNativeEventsDetailMap;
|
|
@@ -1230,9 +1247,23 @@ declare type RecommendationsReadyEventDetail = {
|
|
|
1230
1247
|
playlist: RecommendationItem[];
|
|
1231
1248
|
};
|
|
1232
1249
|
|
|
1233
|
-
|
|
1250
|
+
/**
|
|
1251
|
+
* @public
|
|
1252
|
+
* emitted when an Error recovery is attempted
|
|
1253
|
+
*/
|
|
1254
|
+
declare const /**
|
|
1255
|
+
@public
|
|
1256
|
+
* when a new player is inserted into the HTML
|
|
1257
|
+
*/ /**
|
|
1258
|
+
* @public
|
|
1259
|
+
* emitted when an Error recovery is attempted
|
|
1260
|
+
*/
|
|
1261
|
+
RECOVER = "recover";
|
|
1234
1262
|
|
|
1235
|
-
|
|
1263
|
+
/**
|
|
1264
|
+
* @public
|
|
1265
|
+
*/
|
|
1266
|
+
declare type RecoverEventDetail = null;
|
|
1236
1267
|
|
|
1237
1268
|
/* Excluded from this release type: REMOTE_SESSION_ENDED */
|
|
1238
1269
|
|
|
@@ -1256,9 +1287,21 @@ declare const /**
|
|
|
1256
1287
|
*/
|
|
1257
1288
|
RESIZE = "resize";
|
|
1258
1289
|
|
|
1259
|
-
|
|
1290
|
+
/**
|
|
1291
|
+
* @public
|
|
1292
|
+
*/
|
|
1293
|
+
declare const /**
|
|
1294
|
+
@public
|
|
1295
|
+
* when a new player is inserted into the HTML
|
|
1296
|
+
*/ /**
|
|
1297
|
+
* @public
|
|
1298
|
+
*/
|
|
1299
|
+
RETRY = "retry";
|
|
1260
1300
|
|
|
1261
|
-
|
|
1301
|
+
/**
|
|
1302
|
+
* @public
|
|
1303
|
+
*/
|
|
1304
|
+
declare type RetryEventDetail = null;
|
|
1262
1305
|
|
|
1263
1306
|
declare const RTL = "is-rtl";
|
|
1264
1307
|
|
|
@@ -1393,7 +1436,7 @@ declare namespace states {
|
|
|
1393
1436
|
RTL,
|
|
1394
1437
|
TV,
|
|
1395
1438
|
ENDED,
|
|
1396
|
-
LIVE,
|
|
1439
|
+
LIVE_2 as LIVE,
|
|
1397
1440
|
ERRORED,
|
|
1398
1441
|
WAITING,
|
|
1399
1442
|
AUTOPLAY,
|
package/plugins/health.d.ts
CHANGED
|
@@ -356,6 +356,7 @@ declare type EventInfo = {
|
|
|
356
356
|
declare namespace events {
|
|
357
357
|
export {
|
|
358
358
|
MOUNT,
|
|
359
|
+
RETRY,
|
|
359
360
|
ERROR,
|
|
360
361
|
CONTEXT_MENU,
|
|
361
362
|
CLICK,
|
|
@@ -407,7 +408,8 @@ declare namespace events {
|
|
|
407
408
|
LANDSCAPE,
|
|
408
409
|
PORTRAIT,
|
|
409
410
|
DVR,
|
|
410
|
-
|
|
411
|
+
LIVE,
|
|
412
|
+
RECOVER
|
|
411
413
|
}
|
|
412
414
|
}
|
|
413
415
|
|
|
@@ -636,8 +638,6 @@ declare const /**
|
|
|
636
638
|
*/
|
|
637
639
|
LANDSCAPE = "landscape";
|
|
638
640
|
|
|
639
|
-
declare const LIVE = "is-live";
|
|
640
|
-
|
|
641
641
|
/**
|
|
642
642
|
* @public
|
|
643
643
|
* when src is a livestream
|
|
@@ -649,7 +649,9 @@ declare const /**
|
|
|
649
649
|
* @public
|
|
650
650
|
* when src is a livestream
|
|
651
651
|
*/
|
|
652
|
-
|
|
652
|
+
LIVE = "live";
|
|
653
|
+
|
|
654
|
+
declare const LIVE_2 = "is-live";
|
|
653
655
|
|
|
654
656
|
declare const LIVE_SEEKED = "is-live-seeked";
|
|
655
657
|
|
|
@@ -954,33 +956,27 @@ declare type Player = HTMLVideoElement & PlayerEventOverloads & {
|
|
|
954
956
|
|
|
955
957
|
declare type PlayerCustomEventName = keyof PlayerCustomEventsDetailMap;
|
|
956
958
|
|
|
957
|
-
declare type PlayerCustomEventsDetailMap = {
|
|
958
|
-
[
|
|
959
|
-
[
|
|
960
|
-
[CONTEXT_MENU]: ContextMenuEventDetail;
|
|
961
|
-
/* Excluded from this release type: beforeplay */
|
|
962
|
-
/* Excluded from this release type: beforepause */
|
|
963
|
-
/* Excluded from this release type: state */
|
|
959
|
+
declare type PlayerCustomEventsDetailMap = PlayerEmittableCustomEventsDetailMap & {
|
|
960
|
+
[REAP]: ReapEventDetail;
|
|
961
|
+
[SOURCE]: SourceEventDetail;
|
|
964
962
|
[CUEPOINT_START]: CuePointStartEventDetail;
|
|
965
963
|
[CUEPOINT_END]: CuePointEndEventDetail;
|
|
966
|
-
[
|
|
967
|
-
[
|
|
968
|
-
[
|
|
969
|
-
|
|
970
|
-
[
|
|
971
|
-
/* Excluded from this release type: config */
|
|
972
|
-
[QUALITIES]: QualitiesEventDetail;
|
|
973
|
-
/* Excluded from this release type: "error:fatal" */
|
|
974
|
-
[RECOMMENDATIONS_READY]: RecommendationsReadyEventDetail;
|
|
964
|
+
[MOUNT]: MountEventDetail;
|
|
965
|
+
[LIVE]: LiveEventDetail;
|
|
966
|
+
[DVR]: DvrEventDetail;
|
|
967
|
+
[RETRY]: RetryEventDetail;
|
|
968
|
+
[RECOVER]: RecoverEventDetail;
|
|
975
969
|
/* Excluded from this release type: audioonlysource */
|
|
976
970
|
/* Excluded from this release type: renderplugin */
|
|
977
|
-
[DVR]: DvrEventDetail;
|
|
978
|
-
[LIVE_2]: LiveEventDetail;
|
|
979
971
|
/* Excluded from this release type: "seek:queued" */
|
|
980
972
|
/* Excluded from this release type: "seek:cancel" */
|
|
981
973
|
/* Excluded from this release type: "plugin:registered" */
|
|
982
974
|
/* Excluded from this release type: intersectionchange */
|
|
983
|
-
/* Excluded from this release type:
|
|
975
|
+
/* Excluded from this release type: beforeplay */
|
|
976
|
+
/* Excluded from this release type: beforepause */
|
|
977
|
+
/* Excluded from this release type: state */
|
|
978
|
+
/* Excluded from this release type: config */
|
|
979
|
+
/* Excluded from this release type: "error:fatal" */
|
|
984
980
|
};
|
|
985
981
|
|
|
986
982
|
declare type PlayerCustomEventsOverloads = {
|
|
@@ -1019,11 +1015,18 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1019
1015
|
* Sent right before the player src attribute is set. This allows you to change the video URL before playback.
|
|
1020
1016
|
*/
|
|
1021
1017
|
on(event: typeof SOURCE, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof SOURCE]>) => void): Player;
|
|
1022
|
-
|
|
1018
|
+
/**
|
|
1019
|
+
* Emitted when an Error recovery is attempted
|
|
1020
|
+
*/
|
|
1021
|
+
on(event: typeof RECOVER, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof RECOVER]>) => void): Player;
|
|
1023
1022
|
/**
|
|
1024
1023
|
* Sent when a flowplayer instance is about to be removed from the DOM, and any unsafe references are about to be reaped, which allows Single Page Applications to perform the necessary resource cleanups. This is important when working with front-end frameworks like React. This event should never be emitted directly, only listened to.
|
|
1025
1024
|
*/
|
|
1026
1025
|
on(event: typeof REAP, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof REAP]>) => void): Player;
|
|
1026
|
+
/**
|
|
1027
|
+
* Emitted when a player will retry to reload
|
|
1028
|
+
*/
|
|
1029
|
+
on(event: typeof RETRY, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof RETRY]>) => void): Player;
|
|
1027
1030
|
/* Excluded from this release type: on */
|
|
1028
1031
|
/**
|
|
1029
1032
|
* Emitted when the set of underlying qualities has changed.
|
|
@@ -1043,8 +1046,7 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1043
1046
|
/**
|
|
1044
1047
|
* when src is a livestream
|
|
1045
1048
|
*/
|
|
1046
|
-
on(event: typeof
|
|
1047
|
-
/* Excluded from this release type: on */
|
|
1049
|
+
on(event: typeof LIVE, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof LIVE]>) => void): Player;
|
|
1048
1050
|
/* Excluded from this release type: on */
|
|
1049
1051
|
/* Excluded from this release type: on */
|
|
1050
1052
|
/* Excluded from this release type: on */
|
|
@@ -1073,11 +1075,26 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1073
1075
|
*/
|
|
1074
1076
|
off<T>(event: string, handler: (e: FPEvent<T>) => void): Player;
|
|
1075
1077
|
/* Excluded from this release type: poll */
|
|
1076
|
-
emit<T extends PlayerCustomEventName>(event: T, data?: PlayerCustomEventsDetailMap[T]): Player;
|
|
1077
1078
|
/* Excluded from this release type: emit */
|
|
1078
|
-
|
|
1079
|
+
/* Excluded from this release type: emit */
|
|
1080
|
+
emit<T extends PlayerEmittableEventNames>(event: T, data?: PlayerCustomEventsDetailMap[T]): Player;
|
|
1081
|
+
/* Excluded from this release type: emit */
|
|
1082
|
+
};
|
|
1083
|
+
|
|
1084
|
+
declare type PlayerEmittableCustomEventsDetailMap = {
|
|
1085
|
+
[ERROR]: ErrorEventDetail;
|
|
1086
|
+
[CONTEXT_MENU]: ContextMenuEventDetail;
|
|
1087
|
+
[VIEW_ENTER]: ViewEnterEventDetail;
|
|
1088
|
+
[VIEW_LEAVE]: ViewLeaveEventDetail;
|
|
1089
|
+
[QUALITIES]: QualitiesEventDetail;
|
|
1090
|
+
[RECOMMENDATIONS_READY]: RecommendationsReadyEventDetail;
|
|
1079
1091
|
};
|
|
1080
1092
|
|
|
1093
|
+
declare type PlayerEmittableEventNames = keyof PlayerEmittableCustomEventsDetailMap;
|
|
1094
|
+
|
|
1095
|
+
/**
|
|
1096
|
+
* @public
|
|
1097
|
+
*/
|
|
1081
1098
|
declare type PlayerEventOverloads = PlayerNativeEventsOverloads & PlayerCustomEventsOverloads;
|
|
1082
1099
|
|
|
1083
1100
|
declare type PlayerNativeEventName = keyof PlayerNativeEventsDetailMap;
|
|
@@ -1285,9 +1302,23 @@ declare type RecommendationsReadyEventDetail = {
|
|
|
1285
1302
|
|
|
1286
1303
|
declare const RECORD = "health:record";
|
|
1287
1304
|
|
|
1288
|
-
|
|
1305
|
+
/**
|
|
1306
|
+
* @public
|
|
1307
|
+
* emitted when an Error recovery is attempted
|
|
1308
|
+
*/
|
|
1309
|
+
declare const /**
|
|
1310
|
+
@public
|
|
1311
|
+
* when a new player is inserted into the HTML
|
|
1312
|
+
*/ /**
|
|
1313
|
+
* @public
|
|
1314
|
+
* emitted when an Error recovery is attempted
|
|
1315
|
+
*/
|
|
1316
|
+
RECOVER = "recover";
|
|
1289
1317
|
|
|
1290
|
-
|
|
1318
|
+
/**
|
|
1319
|
+
* @public
|
|
1320
|
+
*/
|
|
1321
|
+
declare type RecoverEventDetail = null;
|
|
1291
1322
|
|
|
1292
1323
|
/* Excluded from this release type: REMOTE_SESSION_ENDED */
|
|
1293
1324
|
|
|
@@ -1311,9 +1342,21 @@ declare const /**
|
|
|
1311
1342
|
*/
|
|
1312
1343
|
RESIZE = "resize";
|
|
1313
1344
|
|
|
1314
|
-
|
|
1345
|
+
/**
|
|
1346
|
+
* @public
|
|
1347
|
+
*/
|
|
1348
|
+
declare const /**
|
|
1349
|
+
@public
|
|
1350
|
+
* when a new player is inserted into the HTML
|
|
1351
|
+
*/ /**
|
|
1352
|
+
* @public
|
|
1353
|
+
*/
|
|
1354
|
+
RETRY = "retry";
|
|
1315
1355
|
|
|
1316
|
-
|
|
1356
|
+
/**
|
|
1357
|
+
* @public
|
|
1358
|
+
*/
|
|
1359
|
+
declare type RetryEventDetail = null;
|
|
1317
1360
|
|
|
1318
1361
|
declare const RTL = "is-rtl";
|
|
1319
1362
|
|
|
@@ -1448,7 +1491,7 @@ declare namespace states {
|
|
|
1448
1491
|
RTL,
|
|
1449
1492
|
TV,
|
|
1450
1493
|
ENDED,
|
|
1451
|
-
LIVE,
|
|
1494
|
+
LIVE_2 as LIVE,
|
|
1452
1495
|
ERRORED,
|
|
1453
1496
|
WAITING,
|
|
1454
1497
|
AUTOPLAY,
|
package/plugins/health.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.health=t())}(this,(function(){"use strict";const e="rebuffer",t="rebuffer:ended",i="insights:ttff",n="insights:time_to_first_frag_loaded";var r=Object.freeze({__proto__:null,RECORD:"health:record",REBUFFER:e,REBUFFER_ENDED:t,DISPLAY:"display",TIME_TO_FIRST_FRAME:i,TIME_TO_FIRST_FRAGMENT_LOADED:n});const s="content:loadstart",o="fullscreenenter",a="fullscreenexit",d="loadedmetadata",c="loadeddata",l="progress",u="loadstart",_="pause",h="playing",f="waiting",p="canplay",m="ended",y="seeked",g="seeking";function E(e){try{return!!new URL(e)}catch(e){return!1}}function v(e,t){const i=function(){try{return localStorage.getItem("flowplayer/debug")}catch(e){return""}}(),n=(n,...r)=>{try{const s=(null==t?void 0:t.debug)||i;s&&e.match(s)&&console.log(`flowplayer/${e} -- ${n}`,...r)}catch(e){console.warn(e)}};return n.log=n,n}const T=navigator;function R(e){var t,i;const n=null===(t=e.hls)||void 0===t?void 0:t.bandwidthEstimate;return n?1e-6*n:(null===(i=T.connection)||void 0===i?void 0:i.downlink)||-1}function A(e,t){return async function(e,t){try{await fetch(e,{body:t,method:"POST",mode:"no-cors"})}catch(e){}}(e,JSON.stringify({events:t}))}var O;!function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON",e[e.AUDIO_REQUIRED=2]="AUDIO_REQUIRED"}(O||(O={}));const I=e=>{switch(e){case!0:return O.ON;case!1:return O.OFF;default:return e}};function w(){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 S=[],D="https://ihi.flowplayer.com/v1/health/events";function N(e){if(e.suspended)return;const t=S.slice(0);S.length=0,0!=t.length&&(e.logger.log(`:dispatch events={${t.length}}`),A(function(){try{return"undefined"==typeof window?D:window.__FLOWPLAYER_INSIGHTS_URL?window.__FLOWPLAYER_INSIGHTS_URL:D}catch(e){return D}}(),t))}async function b(e,t,i){const n=await F();S.push(Object.assign(t,n)),e.logger.log(":enqueue",t.event,t),S.length<10&&!i||N(e)}const U=()=>{var e,t;try{const i=window;return null===(t=null===(e=null==i?void 0:i.google)||void 0===e?void 0:e.ima)||void 0===t?void 0:t.VERSION}catch(e){return}},F=async()=>({client_time:Date.now()}),C=(e,t)=>Object.assign(e,{detail:t}),L=(e,{event:t,media_session_id:i,session_id:n,play_range_id:r})=>({event:t,media_session_id:i,session_id:n,play_range_id:r,device_id:e.deviceId(),version:"3.15.1-rc",commit:"724295d1a0158841f0695414becfd4b9e5072361",ima_sdk_version:U(),preload:e.opt("preload"),autoplay:I(e.opt("autoplay")),live:e.opt("live"),dvr:!!e.live_state.dvr,source:e.original_src,downlink_mbs:R(e),page_url:w(),player_id:e.opt("metadata.player_id"),media_id:e.opt("metadata.media_id"),site_id:e.opt("metadata.site_id"),category_id:e.opt("metadata.category_id"),sitegroup_id:e.opt("metadata.sitegroup_id"),token:e.token,plugins:e.plugins.map(e=>e.constructor.name).sort((e,t)=>e.localeCompare(t)),current_time:e.currentTime,external_media_id:e.opt("external_media_id")}),M=e=>({bitrate:null==e?void 0:e.bitrate,resolution:null==e?void 0:e.attrs.RESOLUTION,frame_rate:null==e?void 0:e.attrs["FRAME-RATE"]});function W(e,t,i,n){const r=L(t,e.eventInfo(i)),{before:s,after:o}=n;b(e,((e,t,i)=>Object.assign(e,{state:{before:t,after:i}}))(r,M(s),M(o)))}const k=[1e7]+""+-1e3+-4e3+-8e3+-1e11,x=()=>"undefined"==typeof crypto?"":k.replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16));var B;function G(e){switch(e){case B.MEDIA_PLAYBACK_ABORTED:return"media playback was aborted";case B.MEDIA_ERR_NETWORK:return"a network error occurred";case B.MEDIA_ERR_DECODE:return"unable to decode media content";case B.MEDIA_ERR_SRC_NOT_SUPPORTED:return"unsupported media type";case B.NO_INTERNET:return"no internet connection detected";case B.MIXED_CONTENT:return"cannot load insecure content in a secure context";default:return"an unknown error occurred"}}!function(e){e[e.UNKNOWN=-1]="UNKNOWN",e[e.MEDIA_PLAYBACK_ABORTED=1]="MEDIA_PLAYBACK_ABORTED",e[e.MEDIA_ERR_NETWORK=2]="MEDIA_ERR_NETWORK",e[e.MEDIA_ERR_DECODE=3]="MEDIA_ERR_DECODE",e[e.MEDIA_ERR_SRC_NOT_SUPPORTED=4]="MEDIA_ERR_SRC_NOT_SUPPORTED",e[e.MIXED_CONTENT=1001]="MIXED_CONTENT",e[e.NO_INTERNET=1002]="NO_INTERNET"}(B||(B={}));const H=(e,t)=>{let i=null;return(...n)=>{null!==i&&(clearTimeout(i),i=null),i=setTimeout(()=>t(...n),e)}};var P;!function(e){e[e.Starting=0]="Starting",e[e.ConfigFinalized=1]="ConfigFinalized",e[e.TimerStartedWithAdsAutoplay=2]="TimerStartedWithAdsAutoplay",e[e.TimerStartedWithContentAutoplay=3]="TimerStartedWithContentAutoplay",e[e.TimerStartedWithUserGesture=4]="TimerStartedWithUserGesture",e[e.MetricReported=5]="MetricReported"}(P||(P={}));class TimeToFirstFrame{constructor(e=P.Starting,t=!1,i=!1){this.state=e,this.loadedAd=t,this.requiresUserGesture=i}reset(){this.state=P.Starting,this.loadedAd=!1,this.elapsed=void 0}toJSON(){var e;return{ad_was_requested:this.loadedAd,ms_to_first_frame:Math.round((null===(e=this.elapsed)||void 0===e?void 0:e.duration)||-1)}}startTimer(e){this.state==P.ConfigFinalized&&(this.state=e,performance.mark("ttff:start"))}hasStarted(){return[P.TimerStartedWithAdsAutoplay,P.TimerStartedWithContentAutoplay,P.TimerStartedWithUserGesture].includes(this.state)}stopTimer(e){if(this.hasStarted()){performance.mark("ttff:end");const t=this.elapsed=performance.measure("ttff","ttff:start","ttff:end");this.state=P.MetricReported,e(t)}}}const j=x();class Health{constructor(e,t){let i;this.session_id=j,this.suspended=!1,this.logger=v("health",t.opts),this.media_session_id=x(),this.play_range_id=x(),this.analyticsLoop=setInterval(()=>N(this),2e3),t.on("reap",()=>clearInterval(this.analyticsLoop)),t.on(h,()=>{i!==this.media_session_id&&(i=this.media_session_id,this.first_playing_event_timestamp=Date.now()),this.play_range_id=x()});let n=Date.now()-1e3;t.on("timeupdate",e=>{if(i!==this.media_session_id)return;const r=Date.now();if(r<n)return;n=Date.now()+5e3;const s=L(t,this.eventInfo(e.type)),o=C(s,{duration:(a=t.duration,Number.isFinite(a)?a:a===1/0?-1:void 0)});var a;this.first_playing_event_timestamp&&(Object.assign(o,{ms_since_first_playing:r-this.first_playing_event_timestamp}),this.first_playing_event_timestamp=void 0),b(this,o)});const r=this;if(t.health={get media_session_id(){return r.media_session_id},set media_session_id(e){r.media_session_id=e},get session_id(){return r.session_id},set session_id(e){r.session_id=e},toggle(e){e?r.resume():r.suspend()}},!Health._UNLOAD_SUBSCRIBED){Health._UNLOAD_SUBSCRIBED=!0;const t=t=>e.instances.forEach(e=>e.emit(t.type));document.addEventListener("visibilitychange",e=>{"hidden"==document.visibilityState&&t(e)}),window.addEventListener("pagehide",t)}}eventInfo(e){return{event:e,media_session_id:this.media_session_id,session_id:this.session_id,play_range_id:this.play_range_id}}suspend(){this.suspended=!0,clearInterval(this.analyticsLoop)}resume(){this.suspended=!1,this.analyticsLoop=setInterval(()=>N(this),2e3)}init(r,v,T){if(w().toString().startsWith("data:"))return this.suspend();!function(i){i.on(f,(function(n){if(i.seeking)return;if(i.networkState!==i.NETWORK_LOADING)return;if(i.readyState===i.HAVE_NOTHING)return;const r=Date.now(),s=e=>{i.off(p,s),i.off("src",s),i.off("error",s),e.type===p&&i.emit(t,{rebuffer_duration:(Date.now()-r)/1e3})};i.on([p,"error","src"],s),i.emit(e)}))}(T),function(e){let t;[p,s].forEach(i=>{e.on(i,i=>{const r=Date.now();switch(i.type){case s:return t=r;case p:if(t)return e.emit(n,{ms_since_loading_started:r-t}),t=null}})})}(T),function(e){if(void 0===window.performance)return;const t=new TimeToFirstFrame;e.on("ovp:config:finalized",e=>{t.reset(),t.state=P.ConfigFinalized,t.requiresUserGesture=!e.detail.autoplay}),e.on(s,()=>{e.root.classList.contains("ad-hide-first-frame")&&t.startTimer(P.TimerStartedWithAdsAutoplay),e.opt("autoplay")&&t.startTimer(P.TimerStartedWithContentAutoplay)}),e.on("click",()=>{e.opt("autoplay")||t.startTimer(P.TimerStartedWithUserGesture)}),e.on("ad-requested",()=>{t.loadedAd=!0}),e.on("timeupdate",()=>{if(!(e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))switch(t.state){case P.TimerStartedWithContentAutoplay:case P.TimerStartedWithUserGesture:return t.stopTimer(()=>e.emit(i,t.toJSON()))}}),e.on("ad-started",()=>{switch(t.state){case P.TimerStartedWithAdsAutoplay:case P.TimerStartedWithUserGesture:return t.stopTimer(()=>e.emit(i,t.toJSON()))}})}(T),T.on("display",e=>{b(this,L(T,this.eventInfo(e.type)),!0)}),T.on("health:record",({detail:e})=>{const t=L(T,this.eventInfo(e.event));Object.assign(t,e.detail||{}),b(this,t)}),[u,d,c,l,f,e].forEach(e=>{T.on(e,e=>{b(this,L(T,this.eventInfo(e.type)))})}),[t,i,n].forEach(e=>{T.on(e,e=>{const t=L(T,this.eventInfo(e.type));b(this,Object.assign(t,e.detail))})}),[h,_,g,y,m,o,a,p,s].forEach(e=>{T.on(e,e=>{b(this,L(T,this.eventInfo(e.type)))})}),T.on("volumechange",H(800,e=>{const t=L(T,this.eventInfo(e.type));b(this,C(t,{volume:parseFloat(T.volume.toFixed(2)),muted:T.muted}))})),T.on("resize",H(800,e=>{const t=L(T,this.eventInfo(e.type));b(this,C(t,{height:v.clientHeight,width:v.clientWidth}))})),T.on("hls/failover",e=>{const t=L(T,this.eventInfo(e.type)),i=e.detail,{reason:n,from:r}=i;b(this,C(t,{reason:n,from:r}))}),T.on("qualitychange",({type:e,detail:t})=>{switch(t.kind){case"hls":return W(this,T,e,t)}}),T.addEventListener("error",e=>{const t=L(T,this.eventInfo(e.type)),i=e.error||T.error;if(!i)return b(this,t,!0);const n=i.code,r={error_message:i.message||G(n),error_code:n,error_stack:i.stack||""};return b(this,C(t,r),!0)}),T.on("src",e=>{var t;const i=null===(t=e.detail)||void 0===t?void 0:t.src;if("string"!=typeof i)return;if(!E(T.original_src))return;if(!E(i))return;if(i==T.original_src)return;this.media_session_id=x();b(this,L(T,this.eventInfo(e.type))),N(this)}),T.on("visibilitychange",e=>{b(this,L(T,this.eventInfo(e.type))),N(this)})}}return Health.events=r,Health._UNLOAD_SUBSCRIBED=!1,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,Health)}));
|
|
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.health=t())}(this,(function(){"use strict";const e="rebuffer",t="rebuffer:ended",i="insights:ttff",n="insights:time_to_first_frag_loaded";var s=Object.freeze({__proto__:null,RECORD:"health:record",REBUFFER:e,REBUFFER_ENDED:t,DISPLAY:"display",TIME_TO_FIRST_FRAME:i,TIME_TO_FIRST_FRAGMENT_LOADED:n});const r="fullscreenenter",o="fullscreenexit",a="loadedmetadata",d="loadeddata",l="progress",c="loadstart",u="pause",_="playing",h="waiting",f="canplay",p="ended",m="seeked",y="seeking",E="content:loadstart",g=[E,"error","src"];function v(e){try{return!!new URL(e)}catch(e){return!1}}function T(e,t){const i=function(){try{return localStorage.getItem("flowplayer/debug")}catch(e){return""}}(),n=(n,...s)=>{try{const r=(null==t?void 0:t.debug)||i;r&&e.match(r)&&console.log(`flowplayer/${e} -- ${n}`,...s)}catch(e){console.warn(e)}};return n.log=n,n}const R=navigator;function A(e){var t,i;const n=null===(t=e.hls)||void 0===t?void 0:t.bandwidthEstimate;return n?1e-6*n:(null===(i=R.connection)||void 0===i?void 0:i.downlink)||-1}function O(e,t){return async function(e,t){try{await fetch(e,{body:t,method:"POST",mode:"no-cors"})}catch(e){}}(e,JSON.stringify({events:t}))}var S;!function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON",e[e.AUDIO_REQUIRED=2]="AUDIO_REQUIRED"}(S||(S={}));const I=e=>{switch(e){case!0:return S.ON;case!1:return S.OFF;default:return e}};function w(){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 D=[],N="https://ihi.flowplayer.com/v1/health/events";function U(e){if(e.suspended)return;const t=D.slice(0);D.length=0,0!=t.length&&(e.logger.log(`:dispatch events={${t.length}}`),O(function(){try{return"undefined"==typeof window?N:window.__FLOWPLAYER_INSIGHTS_URL?window.__FLOWPLAYER_INSIGHTS_URL:N}catch(e){return N}}(),t))}async function b(e,t,i){const n=await F();D.push(Object.assign(t,n)),e.logger.log(":enqueue",t.event,t),D.length<10&&!i||U(e)}const C=()=>{var e,t;try{const i=window;return null===(t=null===(e=null==i?void 0:i.google)||void 0===e?void 0:e.ima)||void 0===t?void 0:t.VERSION}catch(e){return}},F=async()=>({client_time:Date.now()}),M=(e,t)=>Object.assign(e,{detail:t}),L=(e,{event:t,media_session_id:i,session_id:n,play_range_id:s})=>({event:t,media_session_id:i,session_id:n,play_range_id:s,device_id:e.deviceId(),version:"3.16.0-rc",commit:"c7470da24ea302ad51d5d3502d52ccb67872237c",ima_sdk_version:C(),preload:e.opt("preload"),autoplay:I(e.opt("autoplay")),live:e.opt("live"),dvr:!!e.live_state.dvr,source:e.original_src,downlink_mbs:A(e),page_url:w(),player_id:e.opt("metadata.player_id"),media_id:e.opt("metadata.media_id"),site_id:e.opt("metadata.site_id"),category_id:e.opt("metadata.category_id"),sitegroup_id:e.opt("metadata.sitegroup_id"),token:e.token,plugins:e.plugins.map(e=>e.constructor.name).sort((e,t)=>e.localeCompare(t)),current_time:e.currentTime,external_media_id:e.opt("external_media_id")}),W=e=>({bitrate:null==e?void 0:e.bitrate,resolution:null==e?void 0:e.attrs.RESOLUTION,frame_rate:null==e?void 0:e.attrs["FRAME-RATE"]});function k(e,t,i,n){const s=L(t,e.eventInfo(i)),{before:r,after:o}=n;b(e,((e,t,i)=>Object.assign(e,{state:{before:t,after:i}}))(s,W(r),W(o)))}const x=[1e7]+""+-1e3+-4e3+-8e3+-1e11,B=()=>"undefined"==typeof crypto?"":x.replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16));var H;function P(e){switch(e){case H.MEDIA_PLAYBACK_ABORTED:return"media playback was aborted";case H.MEDIA_ERR_NETWORK:return"a network error occurred";case H.MEDIA_ERR_DECODE:return"unable to decode media content";case H.MEDIA_ERR_SRC_NOT_SUPPORTED:return"unsupported media type";case H.NO_INTERNET:return"no internet connection detected";case H.MIXED_CONTENT:return"cannot load insecure content in a secure context";default:return"an unknown error occurred"}}!function(e){e[e.UNKNOWN=-1]="UNKNOWN",e[e.MEDIA_PLAYBACK_ABORTED=1]="MEDIA_PLAYBACK_ABORTED",e[e.MEDIA_ERR_NETWORK=2]="MEDIA_ERR_NETWORK",e[e.MEDIA_ERR_DECODE=3]="MEDIA_ERR_DECODE",e[e.MEDIA_ERR_SRC_NOT_SUPPORTED=4]="MEDIA_ERR_SRC_NOT_SUPPORTED",e[e.MIXED_CONTENT=1001]="MIXED_CONTENT",e[e.NO_INTERNET=1002]="NO_INTERNET"}(H||(H={}));const G=(e,t)=>{let i=null;return(...n)=>{null!==i&&(clearTimeout(i),i=null),i=setTimeout(()=>t(...n),e)}};var j;!function(e){e[e.Starting=0]="Starting",e[e.ConfigFinalized=1]="ConfigFinalized",e[e.TimerStartedWithAdsAutoplay=2]="TimerStartedWithAdsAutoplay",e[e.TimerStartedWithContentAutoplay=3]="TimerStartedWithContentAutoplay",e[e.TimerStartedWithUserGesture=4]="TimerStartedWithUserGesture",e[e.MetricReported=5]="MetricReported"}(j||(j={}));class TimeToFirstFrame{constructor(e=j.Starting,t=!1,i=!1){this.state=e,this.loadedAd=t,this.requiresUserGesture=i}reset(){this.state=j.Starting,this.loadedAd=!1,this.elapsed=void 0}toJSON(){var e;return{ad_was_requested:this.loadedAd,ms_to_first_frame:Math.round((null===(e=this.elapsed)||void 0===e?void 0:e.duration)||-1)}}startTimer(e){this.state==j.ConfigFinalized&&(this.state=e,performance.mark("ttff:start"))}hasStarted(){return[j.TimerStartedWithAdsAutoplay,j.TimerStartedWithContentAutoplay,j.TimerStartedWithUserGesture].includes(this.state)}stopTimer(e){if(this.hasStarted()){performance.mark("ttff:end");const t=this.elapsed=performance.measure("ttff","ttff:start","ttff:end");this.state=j.MetricReported,e(t)}}}const K=B();class Health{constructor(e,t){let i;this.session_id=K,this.suspended=!1,this.logger=T("health",t.opts),this.media_session_id=B(),this.play_range_id=B(),this.analyticsLoop=setInterval(()=>U(this),2e3),t.on("reap",()=>clearInterval(this.analyticsLoop)),t.on(_,()=>{i!==this.media_session_id&&(i=this.media_session_id,this.first_playing_event_timestamp=Date.now()),this.play_range_id=B()});let n=Date.now()-1e3;t.on("timeupdate",e=>{if(i!==this.media_session_id)return;const s=Date.now();if(s<n)return;n=Date.now()+5e3;const r=L(t,this.eventInfo(e.type)),o=M(r,{duration:(a=t.duration,Number.isFinite(a)?a:a===1/0?-1:void 0)});var a;this.first_playing_event_timestamp&&(Object.assign(o,{ms_since_first_playing:s-this.first_playing_event_timestamp}),this.first_playing_event_timestamp=void 0),b(this,o)});const s=this;if(t.health={get media_session_id(){return s.media_session_id},set media_session_id(e){s.media_session_id=e},get session_id(){return s.session_id},set session_id(e){s.session_id=e},toggle(e){e?s.resume():s.suspend()}},!Health._UNLOAD_SUBSCRIBED){Health._UNLOAD_SUBSCRIBED=!0;const t=t=>e.instances.forEach(e=>e.emit(t.type));document.addEventListener("visibilitychange",e=>{"hidden"==document.visibilityState&&t(e)}),window.addEventListener("pagehide",t)}}eventInfo(e){return{event:e,media_session_id:this.media_session_id,session_id:this.session_id,play_range_id:this.play_range_id}}suspend(){this.suspended=!0,clearInterval(this.analyticsLoop)}resume(){this.suspended=!1,this.analyticsLoop=setInterval(()=>U(this),2e3)}init(s,T,R){if(w().toString().startsWith("data:"))return this.suspend();!function(i){let n=null;const s=()=>{n=null};i.on(h,(function(t){i.seeking||i.networkState===i.NETWORK_LOADING&&(i.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||i.emit(e))})),i.on(e,e=>{n=e}),i.on(f,e=>{if(n){const r=e.timeStamp-n.timeStamp;if(s(),r<31)return;if(r>3e5)return;i.emit(t,{rebuffer_duration:r/1e3})}}),g.forEach(e=>i.on(e,s))}(R),function(e){let t;[f,E].forEach(i=>{e.on(i,i=>{const s=Date.now();switch(i.type){case E:return t=s;case f:if(t)return e.emit(n,{ms_since_loading_started:s-t}),t=null}})})}(R),function(e){if(void 0===window.performance)return;const t=new TimeToFirstFrame;e.on("ovp:config:finalized",e=>{t.reset(),t.state=j.ConfigFinalized,t.requiresUserGesture=!e.detail.autoplay}),e.on(E,()=>{e.root.classList.contains("ad-hide-first-frame")&&t.startTimer(j.TimerStartedWithAdsAutoplay),e.opt("autoplay")&&t.startTimer(j.TimerStartedWithContentAutoplay)}),e.on("click",()=>{e.opt("autoplay")||t.startTimer(j.TimerStartedWithUserGesture)}),e.on("ad-requested",()=>{t.loadedAd=!0}),e.on("timeupdate",()=>{if(!(e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))switch(t.state){case j.TimerStartedWithContentAutoplay:case j.TimerStartedWithUserGesture:return t.stopTimer(()=>e.emit(i,t.toJSON()))}}),e.on("ad-started",()=>{switch(t.state){case j.TimerStartedWithAdsAutoplay:case j.TimerStartedWithUserGesture:return t.stopTimer(()=>e.emit(i,t.toJSON()))}})}(R),R.on("display",e=>{b(this,L(R,this.eventInfo(e.type)),!0)}),R.on("health:record",({detail:e})=>{const t=L(R,this.eventInfo(e.event));Object.assign(t,e.detail||{}),b(this,t)}),[c,a,d,l,h,e].forEach(e=>{R.on(e,e=>{b(this,L(R,this.eventInfo(e.type)))})}),[t,i,n].forEach(e=>{R.on(e,e=>{const t=L(R,this.eventInfo(e.type));b(this,Object.assign(t,e.detail))})}),[_,u,y,m,p,r,o,f,E].forEach(e=>{R.on(e,e=>{b(this,L(R,this.eventInfo(e.type)))})}),R.on("volumechange",G(800,e=>{const t=L(R,this.eventInfo(e.type));b(this,M(t,{volume:parseFloat(R.volume.toFixed(2)),muted:R.muted}))})),R.on("resize",G(800,e=>{const t=L(R,this.eventInfo(e.type));b(this,M(t,{height:T.clientHeight,width:T.clientWidth}))})),R.on("hls/failover",e=>{const t=L(R,this.eventInfo(e.type)),i=e.detail,{reason:n,from:s}=i;b(this,M(t,{reason:n,from:s}))}),R.on("qualitychange",({type:e,detail:t})=>{switch(t.kind){case"hls":return k(this,R,e,t)}}),R.addEventListener("error",e=>{const t=L(R,this.eventInfo(e.type)),i=e.error||R.error;if(!i)return b(this,t,!0);const n=i.code,s={error_message:i.message||P(n),error_code:n,error_stack:i.stack||""};return b(this,M(t,s),!0)}),R.on("src",e=>{var t;const i=null===(t=e.detail)||void 0===t?void 0:t.src;if("string"!=typeof i)return;if(!v(R.original_src))return;if(!v(i))return;if(i==R.original_src)return;this.media_session_id=B();b(this,L(R,this.eventInfo(e.type))),U(this)}),R.on("visibilitychange",e=>{b(this,L(R,this.eventInfo(e.type))),U(this)})}}return Health.events=s,Health._UNLOAD_SUBSCRIBED=!1,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,Health)}));
|
package/plugins/hls.d.ts
CHANGED
|
@@ -354,6 +354,7 @@ declare namespace events {
|
|
|
354
354
|
declare namespace events_2 {
|
|
355
355
|
export {
|
|
356
356
|
MOUNT,
|
|
357
|
+
RETRY,
|
|
357
358
|
ERROR,
|
|
358
359
|
CONTEXT_MENU,
|
|
359
360
|
CLICK,
|
|
@@ -405,7 +406,8 @@ declare namespace events_2 {
|
|
|
405
406
|
LANDSCAPE,
|
|
406
407
|
PORTRAIT,
|
|
407
408
|
DVR,
|
|
408
|
-
|
|
409
|
+
LIVE,
|
|
410
|
+
RECOVER
|
|
409
411
|
}
|
|
410
412
|
}
|
|
411
413
|
|
|
@@ -655,8 +657,6 @@ declare const /**
|
|
|
655
657
|
*/
|
|
656
658
|
LANDSCAPE = "landscape";
|
|
657
659
|
|
|
658
|
-
declare const LIVE = "is-live";
|
|
659
|
-
|
|
660
660
|
/**
|
|
661
661
|
* @public
|
|
662
662
|
* when src is a livestream
|
|
@@ -668,7 +668,9 @@ declare const /**
|
|
|
668
668
|
* @public
|
|
669
669
|
* when src is a livestream
|
|
670
670
|
*/
|
|
671
|
-
|
|
671
|
+
LIVE = "live";
|
|
672
|
+
|
|
673
|
+
declare const LIVE_2 = "is-live";
|
|
672
674
|
|
|
673
675
|
declare const LIVE_SEEKED = "is-live-seeked";
|
|
674
676
|
|
|
@@ -968,33 +970,27 @@ declare type Player = HTMLVideoElement & PlayerEventOverloads & {
|
|
|
968
970
|
|
|
969
971
|
declare type PlayerCustomEventName = keyof PlayerCustomEventsDetailMap;
|
|
970
972
|
|
|
971
|
-
declare type PlayerCustomEventsDetailMap = {
|
|
972
|
-
[
|
|
973
|
-
[
|
|
974
|
-
[CONTEXT_MENU]: ContextMenuEventDetail;
|
|
975
|
-
/* Excluded from this release type: beforeplay */
|
|
976
|
-
/* Excluded from this release type: beforepause */
|
|
977
|
-
/* Excluded from this release type: state */
|
|
973
|
+
declare type PlayerCustomEventsDetailMap = PlayerEmittableCustomEventsDetailMap & {
|
|
974
|
+
[REAP]: ReapEventDetail;
|
|
975
|
+
[SOURCE]: SourceEventDetail;
|
|
978
976
|
[CUEPOINT_START]: CuePointStartEventDetail;
|
|
979
977
|
[CUEPOINT_END]: CuePointEndEventDetail;
|
|
980
|
-
[
|
|
981
|
-
[
|
|
982
|
-
[
|
|
983
|
-
|
|
984
|
-
[
|
|
985
|
-
/* Excluded from this release type: config */
|
|
986
|
-
[QUALITIES]: QualitiesEventDetail;
|
|
987
|
-
/* Excluded from this release type: "error:fatal" */
|
|
988
|
-
[RECOMMENDATIONS_READY]: RecommendationsReadyEventDetail;
|
|
978
|
+
[MOUNT]: MountEventDetail;
|
|
979
|
+
[LIVE]: LiveEventDetail;
|
|
980
|
+
[DVR]: DvrEventDetail;
|
|
981
|
+
[RETRY]: RetryEventDetail;
|
|
982
|
+
[RECOVER]: RecoverEventDetail;
|
|
989
983
|
/* Excluded from this release type: audioonlysource */
|
|
990
984
|
/* Excluded from this release type: renderplugin */
|
|
991
|
-
[DVR]: DvrEventDetail;
|
|
992
|
-
[LIVE_2]: LiveEventDetail;
|
|
993
985
|
/* Excluded from this release type: "seek:queued" */
|
|
994
986
|
/* Excluded from this release type: "seek:cancel" */
|
|
995
987
|
/* Excluded from this release type: "plugin:registered" */
|
|
996
988
|
/* Excluded from this release type: intersectionchange */
|
|
997
|
-
/* Excluded from this release type:
|
|
989
|
+
/* Excluded from this release type: beforeplay */
|
|
990
|
+
/* Excluded from this release type: beforepause */
|
|
991
|
+
/* Excluded from this release type: state */
|
|
992
|
+
/* Excluded from this release type: config */
|
|
993
|
+
/* Excluded from this release type: "error:fatal" */
|
|
998
994
|
};
|
|
999
995
|
|
|
1000
996
|
declare type PlayerCustomEventsOverloads = {
|
|
@@ -1033,11 +1029,18 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1033
1029
|
* Sent right before the player src attribute is set. This allows you to change the video URL before playback.
|
|
1034
1030
|
*/
|
|
1035
1031
|
on(event: typeof SOURCE, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof SOURCE]>) => void): Player;
|
|
1036
|
-
|
|
1032
|
+
/**
|
|
1033
|
+
* Emitted when an Error recovery is attempted
|
|
1034
|
+
*/
|
|
1035
|
+
on(event: typeof RECOVER, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof RECOVER]>) => void): Player;
|
|
1037
1036
|
/**
|
|
1038
1037
|
* Sent when a flowplayer instance is about to be removed from the DOM, and any unsafe references are about to be reaped, which allows Single Page Applications to perform the necessary resource cleanups. This is important when working with front-end frameworks like React. This event should never be emitted directly, only listened to.
|
|
1039
1038
|
*/
|
|
1040
1039
|
on(event: typeof REAP, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof REAP]>) => void): Player;
|
|
1040
|
+
/**
|
|
1041
|
+
* Emitted when a player will retry to reload
|
|
1042
|
+
*/
|
|
1043
|
+
on(event: typeof RETRY, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof RETRY]>) => void): Player;
|
|
1041
1044
|
/* Excluded from this release type: on */
|
|
1042
1045
|
/**
|
|
1043
1046
|
* Emitted when the set of underlying qualities has changed.
|
|
@@ -1057,8 +1060,7 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1057
1060
|
/**
|
|
1058
1061
|
* when src is a livestream
|
|
1059
1062
|
*/
|
|
1060
|
-
on(event: typeof
|
|
1061
|
-
/* Excluded from this release type: on */
|
|
1063
|
+
on(event: typeof LIVE, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof LIVE]>) => void): Player;
|
|
1062
1064
|
/* Excluded from this release type: on */
|
|
1063
1065
|
/* Excluded from this release type: on */
|
|
1064
1066
|
/* Excluded from this release type: on */
|
|
@@ -1087,11 +1089,26 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1087
1089
|
*/
|
|
1088
1090
|
off<T>(event: string, handler: (e: FPEvent<T>) => void): Player;
|
|
1089
1091
|
/* Excluded from this release type: poll */
|
|
1090
|
-
emit<T extends PlayerCustomEventName>(event: T, data?: PlayerCustomEventsDetailMap[T]): Player;
|
|
1091
1092
|
/* Excluded from this release type: emit */
|
|
1092
|
-
|
|
1093
|
+
/* Excluded from this release type: emit */
|
|
1094
|
+
emit<T extends PlayerEmittableEventNames>(event: T, data?: PlayerCustomEventsDetailMap[T]): Player;
|
|
1095
|
+
/* Excluded from this release type: emit */
|
|
1096
|
+
};
|
|
1097
|
+
|
|
1098
|
+
declare type PlayerEmittableCustomEventsDetailMap = {
|
|
1099
|
+
[ERROR]: ErrorEventDetail;
|
|
1100
|
+
[CONTEXT_MENU]: ContextMenuEventDetail;
|
|
1101
|
+
[VIEW_ENTER]: ViewEnterEventDetail;
|
|
1102
|
+
[VIEW_LEAVE]: ViewLeaveEventDetail;
|
|
1103
|
+
[QUALITIES]: QualitiesEventDetail;
|
|
1104
|
+
[RECOMMENDATIONS_READY]: RecommendationsReadyEventDetail;
|
|
1093
1105
|
};
|
|
1094
1106
|
|
|
1107
|
+
declare type PlayerEmittableEventNames = keyof PlayerEmittableCustomEventsDetailMap;
|
|
1108
|
+
|
|
1109
|
+
/**
|
|
1110
|
+
* @public
|
|
1111
|
+
*/
|
|
1095
1112
|
declare type PlayerEventOverloads = PlayerNativeEventsOverloads & PlayerCustomEventsOverloads;
|
|
1096
1113
|
|
|
1097
1114
|
declare type PlayerNativeEventName = keyof PlayerNativeEventsDetailMap;
|
|
@@ -1290,9 +1307,23 @@ declare type RecommendationsReadyEventDetail = {
|
|
|
1290
1307
|
playlist: RecommendationItem[];
|
|
1291
1308
|
};
|
|
1292
1309
|
|
|
1293
|
-
|
|
1310
|
+
/**
|
|
1311
|
+
* @public
|
|
1312
|
+
* emitted when an Error recovery is attempted
|
|
1313
|
+
*/
|
|
1314
|
+
declare const /**
|
|
1315
|
+
@public
|
|
1316
|
+
* when a new player is inserted into the HTML
|
|
1317
|
+
*/ /**
|
|
1318
|
+
* @public
|
|
1319
|
+
* emitted when an Error recovery is attempted
|
|
1320
|
+
*/
|
|
1321
|
+
RECOVER = "recover";
|
|
1294
1322
|
|
|
1295
|
-
|
|
1323
|
+
/**
|
|
1324
|
+
* @public
|
|
1325
|
+
*/
|
|
1326
|
+
declare type RecoverEventDetail = null;
|
|
1296
1327
|
|
|
1297
1328
|
/* Excluded from this release type: REMOTE_SESSION_ENDED */
|
|
1298
1329
|
|
|
@@ -1316,9 +1347,21 @@ declare const /**
|
|
|
1316
1347
|
*/
|
|
1317
1348
|
RESIZE = "resize";
|
|
1318
1349
|
|
|
1319
|
-
|
|
1350
|
+
/**
|
|
1351
|
+
* @public
|
|
1352
|
+
*/
|
|
1353
|
+
declare const /**
|
|
1354
|
+
@public
|
|
1355
|
+
* when a new player is inserted into the HTML
|
|
1356
|
+
*/ /**
|
|
1357
|
+
* @public
|
|
1358
|
+
*/
|
|
1359
|
+
RETRY = "retry";
|
|
1320
1360
|
|
|
1321
|
-
|
|
1361
|
+
/**
|
|
1362
|
+
* @public
|
|
1363
|
+
*/
|
|
1364
|
+
declare type RetryEventDetail = null;
|
|
1322
1365
|
|
|
1323
1366
|
declare const RTL = "is-rtl";
|
|
1324
1367
|
|
|
@@ -1453,7 +1496,7 @@ declare namespace states {
|
|
|
1453
1496
|
RTL,
|
|
1454
1497
|
TV,
|
|
1455
1498
|
ENDED,
|
|
1456
|
-
LIVE,
|
|
1499
|
+
LIVE_2 as LIVE,
|
|
1457
1500
|
ERRORED,
|
|
1458
1501
|
WAITING,
|
|
1459
1502
|
AUTOPLAY,
|