@flowplayer/player 3.16.0-rc → 3.16.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.d.ts +2 -8
- package/core/events.js +1 -4
- package/core.js +1 -1
- package/default.js +1 -1
- package/embed.js +2 -2
- package/flowplayer.css +1 -1
- package/index.d.ts +29 -40
- package/package.json +1 -1
- package/plugins/ads.d.ts +29 -40
- package/plugins/ads.js +1 -1
- package/plugins/airplay.d.ts +29 -40
- package/plugins/analytics.d.ts +29 -40
- package/plugins/analytics.js +1 -1
- package/plugins/asel.d.ts +29 -40
- package/plugins/audio.d.ts +29 -40
- package/plugins/chapters.d.ts +29 -40
- package/plugins/chromecast.d.ts +29 -40
- package/plugins/comscore.d.ts +29 -40
- package/plugins/consent.d.ts +78 -41
- package/plugins/consent.js +1 -1
- package/plugins/context-menu.d.ts +29 -40
- package/plugins/cuepoints.d.ts +29 -40
- package/plugins/dash.d.ts +29 -40
- package/plugins/drm.d.ts +29 -40
- package/plugins/endscreen.d.ts +29 -40
- package/plugins/fas.d.ts +29 -40
- package/plugins/float-on-scroll.d.ts +29 -40
- package/plugins/ga4.d.ts +29 -40
- package/plugins/gemius.d.ts +29 -40
- package/plugins/google-analytics.d.ts +29 -40
- package/plugins/health.d.ts +37 -41
- package/plugins/health.js +1 -1
- package/plugins/hls.d.ts +29 -40
- package/plugins/hls.js +1 -1
- package/plugins/id3.d.ts +96 -41
- package/plugins/iframe.d.ts +29 -40
- package/plugins/keyboard.d.ts +29 -40
- package/plugins/media-session.d.ts +29 -40
- package/plugins/message.d.ts +29 -40
- package/plugins/ovp.d.ts +29 -40
- package/plugins/playlist.d.ts +29 -71
- package/plugins/playlist.js +1 -1
- package/plugins/preview.d.ts +29 -40
- package/plugins/qsel.d.ts +102 -38
- package/plugins/qsel.js +1 -1
- package/plugins/qul.d.ts +29 -40
- package/plugins/rts.d.ts +29 -40
- package/plugins/share.d.ts +29 -40
- package/plugins/speed.d.ts +29 -40
- package/plugins/ssai.d.ts +29 -40
- package/plugins/ssai.js +1 -1
- package/plugins/subtitles.d.ts +29 -40
- package/plugins/thumbnails.d.ts +29 -40
- package/plugins/tizen.d.ts +29 -40
- package/plugins/vtsel.d.ts +122 -33
- package/plugins/vtsel.js +1 -1
- package/plugins/webos.d.ts +29 -40
- package/util/loader.d.ts +27 -40
package/plugins/gemius.d.ts
CHANGED
|
@@ -793,6 +793,8 @@ declare const NO_CONTROLS = "no-controls";
|
|
|
793
793
|
|
|
794
794
|
declare const NO_DVR = "no-timeline";
|
|
795
795
|
|
|
796
|
+
declare type NoInfer_2<T> = [T][T extends any ? 0 : never];
|
|
797
|
+
|
|
796
798
|
/* Excluded from this release type: NON_RECOVERABLE_ERROR */
|
|
797
799
|
|
|
798
800
|
/* Excluded from this release type: NonRecoverableErrorEventDetail */
|
|
@@ -933,7 +935,6 @@ declare type Player = HTMLVideoElement & PlayerEventOverloads & {
|
|
|
933
935
|
disabled: boolean;
|
|
934
936
|
/* Excluded from this release type: started */
|
|
935
937
|
/* Excluded from this release type: token */
|
|
936
|
-
tracks?: VideoTrack[];
|
|
937
938
|
/* Excluded from this release type: _customElements */
|
|
938
939
|
/* Excluded from this release type: _storage */
|
|
939
940
|
};
|
|
@@ -1017,6 +1018,7 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1017
1018
|
*/
|
|
1018
1019
|
on(event: typeof QUALITIES, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITIES]>) => void): Player;
|
|
1019
1020
|
/* Excluded from this release type: on */
|
|
1021
|
+
/* Excluded from this release type: on */
|
|
1020
1022
|
/**
|
|
1021
1023
|
* Listen to this event to create a recommendations grid using the data passed with the event.
|
|
1022
1024
|
*/
|
|
@@ -1035,6 +1037,11 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1035
1037
|
/* Excluded from this release type: on */
|
|
1036
1038
|
/* Excluded from this release type: on */
|
|
1037
1039
|
/* Excluded from this release type: on */
|
|
1040
|
+
/* Excluded from this release type: on */
|
|
1041
|
+
/**
|
|
1042
|
+
* TODO: this is a workaround, since not all event overloads are typed. when all plugin work is finished, remove this
|
|
1043
|
+
* https://wowzamedia.jira.com/browse/PLAY-653
|
|
1044
|
+
*/
|
|
1038
1045
|
on<T>(event: string, handler: (e: FPEvent<T>) => void): Player;
|
|
1039
1046
|
/* Excluded from this release type: on */
|
|
1040
1047
|
/**
|
|
@@ -1059,9 +1066,12 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1059
1066
|
*/
|
|
1060
1067
|
off<T>(event: string, handler: (e: FPEvent<T>) => void): Player;
|
|
1061
1068
|
/* Excluded from this release type: poll */
|
|
1069
|
+
emit<T extends PlayerEmittableEventNames>(event: T, data?: PlayerCustomEventsDetailMap[T]): Player;
|
|
1070
|
+
emit(event: never, data?: never): Player;
|
|
1071
|
+
/* Excluded from this release type: emit */
|
|
1072
|
+
/* Excluded from this release type: emit */
|
|
1062
1073
|
/* Excluded from this release type: emit */
|
|
1063
1074
|
/* Excluded from this release type: emit */
|
|
1064
|
-
emit<T extends PlayerEmittableEventNames>(event: T, data?: PlayerCustomEventsDetailMap[T]): Player;
|
|
1065
1075
|
/* Excluded from this release type: emit */
|
|
1066
1076
|
};
|
|
1067
1077
|
|
|
@@ -1169,6 +1179,17 @@ declare const /**
|
|
|
1169
1179
|
*/
|
|
1170
1180
|
PROGRESS = "progress";
|
|
1171
1181
|
|
|
1182
|
+
/**
|
|
1183
|
+
* @public
|
|
1184
|
+
*/
|
|
1185
|
+
declare type QselOption = {
|
|
1186
|
+
height: number;
|
|
1187
|
+
level: number;
|
|
1188
|
+
text: string;
|
|
1189
|
+
/* Excluded from this release type: videoCodec */
|
|
1190
|
+
width: number;
|
|
1191
|
+
};
|
|
1192
|
+
|
|
1172
1193
|
/**
|
|
1173
1194
|
* @public
|
|
1174
1195
|
* emitted whenever a list of qualities has been made available
|
|
@@ -1187,27 +1208,11 @@ QUALITIES = "qualities";
|
|
|
1187
1208
|
/**
|
|
1188
1209
|
* @public
|
|
1189
1210
|
*/
|
|
1190
|
-
declare type QualitiesEventDetail =
|
|
1211
|
+
declare type QualitiesEventDetail = QselOption[];
|
|
1191
1212
|
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
*/
|
|
1195
|
-
declare type QualityDetail = {
|
|
1196
|
-
level: number;
|
|
1197
|
-
text: string;
|
|
1198
|
-
width: number;
|
|
1199
|
-
height: number;
|
|
1200
|
-
videoCodec: string;
|
|
1201
|
-
} | BitrateInfo | {
|
|
1202
|
-
text: string | number;
|
|
1203
|
-
encodingId: string;
|
|
1204
|
-
spatialLayerId: number;
|
|
1205
|
-
temporalLayerId: number;
|
|
1206
|
-
maxSpatialLayerId: number;
|
|
1207
|
-
maxTemporalLayerId: number;
|
|
1208
|
-
height: number;
|
|
1209
|
-
width: number;
|
|
1210
|
-
};
|
|
1213
|
+
/* Excluded from this release type: _QualitiesEventDetail */
|
|
1214
|
+
|
|
1215
|
+
/* Excluded from this release type: _QualityDetail */
|
|
1211
1216
|
|
|
1212
1217
|
declare enum QualityOpts {
|
|
1213
1218
|
LOW = 1,
|
|
@@ -1379,20 +1384,14 @@ SEEKING_2 = "seeking";
|
|
|
1379
1384
|
|
|
1380
1385
|
/**
|
|
1381
1386
|
* @public
|
|
1382
|
-
*
|
|
1383
|
-
* it should emit the index of the quality to set
|
|
1384
|
-
* -1 is a special idx saying to use ABR if the plugin
|
|
1385
|
-
* exposes an ABR implementation
|
|
1387
|
+
* @deprecated please use Qsel.events.SET_QUALITY
|
|
1386
1388
|
*/
|
|
1387
1389
|
declare const /**
|
|
1388
1390
|
@public
|
|
1389
1391
|
* when a new player is inserted into the HTML
|
|
1390
1392
|
*/ /**
|
|
1391
1393
|
* @public
|
|
1392
|
-
*
|
|
1393
|
-
* it should emit the index of the quality to set
|
|
1394
|
-
* -1 is a special idx saying to use ABR if the plugin
|
|
1395
|
-
* exposes an ABR implementation
|
|
1394
|
+
* @deprecated please use Qsel.events.SET_QUALITY
|
|
1396
1395
|
*/
|
|
1397
1396
|
SET_QUALITY = "quality:set";
|
|
1398
1397
|
|
|
@@ -1581,16 +1580,6 @@ declare const /**
|
|
|
1581
1580
|
*/
|
|
1582
1581
|
VIDEO_TRACKS = "videoTracks";
|
|
1583
1582
|
|
|
1584
|
-
/**
|
|
1585
|
-
* @public
|
|
1586
|
-
*/
|
|
1587
|
-
declare interface VideoTrack {
|
|
1588
|
-
name: string;
|
|
1589
|
-
/* Excluded from this release type: data */
|
|
1590
|
-
default: boolean;
|
|
1591
|
-
selected: boolean;
|
|
1592
|
-
}
|
|
1593
|
-
|
|
1594
1583
|
/**
|
|
1595
1584
|
* @public
|
|
1596
1585
|
* when a player enters the viewpoint
|
|
@@ -768,6 +768,8 @@ declare const NO_CONTROLS = "no-controls";
|
|
|
768
768
|
|
|
769
769
|
declare const NO_DVR = "no-timeline";
|
|
770
770
|
|
|
771
|
+
declare type NoInfer_2<T> = [T][T extends any ? 0 : never];
|
|
772
|
+
|
|
771
773
|
/* Excluded from this release type: NON_RECOVERABLE_ERROR */
|
|
772
774
|
|
|
773
775
|
/* Excluded from this release type: NonRecoverableErrorEventDetail */
|
|
@@ -908,7 +910,6 @@ declare type Player = HTMLVideoElement & PlayerEventOverloads & {
|
|
|
908
910
|
disabled: boolean;
|
|
909
911
|
/* Excluded from this release type: started */
|
|
910
912
|
/* Excluded from this release type: token */
|
|
911
|
-
tracks?: VideoTrack[];
|
|
912
913
|
/* Excluded from this release type: _customElements */
|
|
913
914
|
/* Excluded from this release type: _storage */
|
|
914
915
|
};
|
|
@@ -992,6 +993,7 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
992
993
|
*/
|
|
993
994
|
on(event: typeof QUALITIES, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITIES]>) => void): Player;
|
|
994
995
|
/* Excluded from this release type: on */
|
|
996
|
+
/* Excluded from this release type: on */
|
|
995
997
|
/**
|
|
996
998
|
* Listen to this event to create a recommendations grid using the data passed with the event.
|
|
997
999
|
*/
|
|
@@ -1010,6 +1012,11 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1010
1012
|
/* Excluded from this release type: on */
|
|
1011
1013
|
/* Excluded from this release type: on */
|
|
1012
1014
|
/* Excluded from this release type: on */
|
|
1015
|
+
/* Excluded from this release type: on */
|
|
1016
|
+
/**
|
|
1017
|
+
* TODO: this is a workaround, since not all event overloads are typed. when all plugin work is finished, remove this
|
|
1018
|
+
* https://wowzamedia.jira.com/browse/PLAY-653
|
|
1019
|
+
*/
|
|
1013
1020
|
on<T>(event: string, handler: (e: FPEvent<T>) => void): Player;
|
|
1014
1021
|
/* Excluded from this release type: on */
|
|
1015
1022
|
/**
|
|
@@ -1034,9 +1041,12 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1034
1041
|
*/
|
|
1035
1042
|
off<T>(event: string, handler: (e: FPEvent<T>) => void): Player;
|
|
1036
1043
|
/* Excluded from this release type: poll */
|
|
1044
|
+
emit<T extends PlayerEmittableEventNames>(event: T, data?: PlayerCustomEventsDetailMap[T]): Player;
|
|
1045
|
+
emit(event: never, data?: never): Player;
|
|
1046
|
+
/* Excluded from this release type: emit */
|
|
1047
|
+
/* Excluded from this release type: emit */
|
|
1037
1048
|
/* Excluded from this release type: emit */
|
|
1038
1049
|
/* Excluded from this release type: emit */
|
|
1039
|
-
emit<T extends PlayerEmittableEventNames>(event: T, data?: PlayerCustomEventsDetailMap[T]): Player;
|
|
1040
1050
|
/* Excluded from this release type: emit */
|
|
1041
1051
|
};
|
|
1042
1052
|
|
|
@@ -1144,6 +1154,17 @@ declare const /**
|
|
|
1144
1154
|
*/
|
|
1145
1155
|
PROGRESS = "progress";
|
|
1146
1156
|
|
|
1157
|
+
/**
|
|
1158
|
+
* @public
|
|
1159
|
+
*/
|
|
1160
|
+
declare type QselOption = {
|
|
1161
|
+
height: number;
|
|
1162
|
+
level: number;
|
|
1163
|
+
text: string;
|
|
1164
|
+
/* Excluded from this release type: videoCodec */
|
|
1165
|
+
width: number;
|
|
1166
|
+
};
|
|
1167
|
+
|
|
1147
1168
|
/**
|
|
1148
1169
|
* @public
|
|
1149
1170
|
* emitted whenever a list of qualities has been made available
|
|
@@ -1162,27 +1183,11 @@ QUALITIES = "qualities";
|
|
|
1162
1183
|
/**
|
|
1163
1184
|
* @public
|
|
1164
1185
|
*/
|
|
1165
|
-
declare type QualitiesEventDetail =
|
|
1186
|
+
declare type QualitiesEventDetail = QselOption[];
|
|
1166
1187
|
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
*/
|
|
1170
|
-
declare type QualityDetail = {
|
|
1171
|
-
level: number;
|
|
1172
|
-
text: string;
|
|
1173
|
-
width: number;
|
|
1174
|
-
height: number;
|
|
1175
|
-
videoCodec: string;
|
|
1176
|
-
} | BitrateInfo | {
|
|
1177
|
-
text: string | number;
|
|
1178
|
-
encodingId: string;
|
|
1179
|
-
spatialLayerId: number;
|
|
1180
|
-
temporalLayerId: number;
|
|
1181
|
-
maxSpatialLayerId: number;
|
|
1182
|
-
maxTemporalLayerId: number;
|
|
1183
|
-
height: number;
|
|
1184
|
-
width: number;
|
|
1185
|
-
};
|
|
1188
|
+
/* Excluded from this release type: _QualitiesEventDetail */
|
|
1189
|
+
|
|
1190
|
+
/* Excluded from this release type: _QualityDetail */
|
|
1186
1191
|
|
|
1187
1192
|
declare enum QualityOpts {
|
|
1188
1193
|
LOW = 1,
|
|
@@ -1354,20 +1359,14 @@ SEEKING_2 = "seeking";
|
|
|
1354
1359
|
|
|
1355
1360
|
/**
|
|
1356
1361
|
* @public
|
|
1357
|
-
*
|
|
1358
|
-
* it should emit the index of the quality to set
|
|
1359
|
-
* -1 is a special idx saying to use ABR if the plugin
|
|
1360
|
-
* exposes an ABR implementation
|
|
1362
|
+
* @deprecated please use Qsel.events.SET_QUALITY
|
|
1361
1363
|
*/
|
|
1362
1364
|
declare const /**
|
|
1363
1365
|
@public
|
|
1364
1366
|
* when a new player is inserted into the HTML
|
|
1365
1367
|
*/ /**
|
|
1366
1368
|
* @public
|
|
1367
|
-
*
|
|
1368
|
-
* it should emit the index of the quality to set
|
|
1369
|
-
* -1 is a special idx saying to use ABR if the plugin
|
|
1370
|
-
* exposes an ABR implementation
|
|
1369
|
+
* @deprecated please use Qsel.events.SET_QUALITY
|
|
1371
1370
|
*/
|
|
1372
1371
|
SET_QUALITY = "quality:set";
|
|
1373
1372
|
|
|
@@ -1556,16 +1555,6 @@ declare const /**
|
|
|
1556
1555
|
*/
|
|
1557
1556
|
VIDEO_TRACKS = "videoTracks";
|
|
1558
1557
|
|
|
1559
|
-
/**
|
|
1560
|
-
* @public
|
|
1561
|
-
*/
|
|
1562
|
-
declare interface VideoTrack {
|
|
1563
|
-
name: string;
|
|
1564
|
-
/* Excluded from this release type: data */
|
|
1565
|
-
default: boolean;
|
|
1566
|
-
selected: boolean;
|
|
1567
|
-
}
|
|
1568
|
-
|
|
1569
1558
|
/**
|
|
1570
1559
|
* @public
|
|
1571
1560
|
* when a player enters the viewpoint
|
package/plugins/health.d.ts
CHANGED
|
@@ -584,7 +584,8 @@ declare namespace HealthEvents {
|
|
|
584
584
|
REBUFFER_ENDED,
|
|
585
585
|
DISPLAY,
|
|
586
586
|
TIME_TO_FIRST_FRAME,
|
|
587
|
-
TIME_TO_FIRST_FRAGMENT_LOADED
|
|
587
|
+
TIME_TO_FIRST_FRAGMENT_LOADED,
|
|
588
|
+
WATCHED_INTERVAL
|
|
588
589
|
}
|
|
589
590
|
}
|
|
590
591
|
|
|
@@ -809,6 +810,8 @@ declare const NO_CONTROLS = "no-controls";
|
|
|
809
810
|
|
|
810
811
|
declare const NO_DVR = "no-timeline";
|
|
811
812
|
|
|
813
|
+
declare type NoInfer_2<T> = [T][T extends any ? 0 : never];
|
|
814
|
+
|
|
812
815
|
/* Excluded from this release type: NON_RECOVERABLE_ERROR */
|
|
813
816
|
|
|
814
817
|
/* Excluded from this release type: NonRecoverableErrorEventDetail */
|
|
@@ -949,7 +952,6 @@ declare type Player = HTMLVideoElement & PlayerEventOverloads & {
|
|
|
949
952
|
disabled: boolean;
|
|
950
953
|
/* Excluded from this release type: started */
|
|
951
954
|
/* Excluded from this release type: token */
|
|
952
|
-
tracks?: VideoTrack[];
|
|
953
955
|
/* Excluded from this release type: _customElements */
|
|
954
956
|
/* Excluded from this release type: _storage */
|
|
955
957
|
};
|
|
@@ -1033,6 +1035,7 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1033
1035
|
*/
|
|
1034
1036
|
on(event: typeof QUALITIES, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITIES]>) => void): Player;
|
|
1035
1037
|
/* Excluded from this release type: on */
|
|
1038
|
+
/* Excluded from this release type: on */
|
|
1036
1039
|
/**
|
|
1037
1040
|
* Listen to this event to create a recommendations grid using the data passed with the event.
|
|
1038
1041
|
*/
|
|
@@ -1051,6 +1054,11 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1051
1054
|
/* Excluded from this release type: on */
|
|
1052
1055
|
/* Excluded from this release type: on */
|
|
1053
1056
|
/* Excluded from this release type: on */
|
|
1057
|
+
/* Excluded from this release type: on */
|
|
1058
|
+
/**
|
|
1059
|
+
* TODO: this is a workaround, since not all event overloads are typed. when all plugin work is finished, remove this
|
|
1060
|
+
* https://wowzamedia.jira.com/browse/PLAY-653
|
|
1061
|
+
*/
|
|
1054
1062
|
on<T>(event: string, handler: (e: FPEvent<T>) => void): Player;
|
|
1055
1063
|
/* Excluded from this release type: on */
|
|
1056
1064
|
/**
|
|
@@ -1075,9 +1083,12 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1075
1083
|
*/
|
|
1076
1084
|
off<T>(event: string, handler: (e: FPEvent<T>) => void): Player;
|
|
1077
1085
|
/* Excluded from this release type: poll */
|
|
1086
|
+
emit<T extends PlayerEmittableEventNames>(event: T, data?: PlayerCustomEventsDetailMap[T]): Player;
|
|
1087
|
+
emit(event: never, data?: never): Player;
|
|
1088
|
+
/* Excluded from this release type: emit */
|
|
1089
|
+
/* Excluded from this release type: emit */
|
|
1078
1090
|
/* Excluded from this release type: emit */
|
|
1079
1091
|
/* Excluded from this release type: emit */
|
|
1080
|
-
emit<T extends PlayerEmittableEventNames>(event: T, data?: PlayerCustomEventsDetailMap[T]): Player;
|
|
1081
1092
|
/* Excluded from this release type: emit */
|
|
1082
1093
|
};
|
|
1083
1094
|
|
|
@@ -1193,6 +1204,17 @@ declare const /**
|
|
|
1193
1204
|
*/
|
|
1194
1205
|
PROGRESS = "progress";
|
|
1195
1206
|
|
|
1207
|
+
/**
|
|
1208
|
+
* @public
|
|
1209
|
+
*/
|
|
1210
|
+
declare type QselOption = {
|
|
1211
|
+
height: number;
|
|
1212
|
+
level: number;
|
|
1213
|
+
text: string;
|
|
1214
|
+
/* Excluded from this release type: videoCodec */
|
|
1215
|
+
width: number;
|
|
1216
|
+
};
|
|
1217
|
+
|
|
1196
1218
|
/**
|
|
1197
1219
|
* @public
|
|
1198
1220
|
* emitted whenever a list of qualities has been made available
|
|
@@ -1211,27 +1233,11 @@ QUALITIES = "qualities";
|
|
|
1211
1233
|
/**
|
|
1212
1234
|
* @public
|
|
1213
1235
|
*/
|
|
1214
|
-
declare type QualitiesEventDetail =
|
|
1236
|
+
declare type QualitiesEventDetail = QselOption[];
|
|
1215
1237
|
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
*/
|
|
1219
|
-
declare type QualityDetail = {
|
|
1220
|
-
level: number;
|
|
1221
|
-
text: string;
|
|
1222
|
-
width: number;
|
|
1223
|
-
height: number;
|
|
1224
|
-
videoCodec: string;
|
|
1225
|
-
} | BitrateInfo | {
|
|
1226
|
-
text: string | number;
|
|
1227
|
-
encodingId: string;
|
|
1228
|
-
spatialLayerId: number;
|
|
1229
|
-
temporalLayerId: number;
|
|
1230
|
-
maxSpatialLayerId: number;
|
|
1231
|
-
maxTemporalLayerId: number;
|
|
1232
|
-
height: number;
|
|
1233
|
-
width: number;
|
|
1234
|
-
};
|
|
1238
|
+
/* Excluded from this release type: _QualitiesEventDetail */
|
|
1239
|
+
|
|
1240
|
+
/* Excluded from this release type: _QualityDetail */
|
|
1235
1241
|
|
|
1236
1242
|
declare enum QualityOpts {
|
|
1237
1243
|
LOW = 1,
|
|
@@ -1409,20 +1415,14 @@ SEEKING_2 = "seeking";
|
|
|
1409
1415
|
|
|
1410
1416
|
/**
|
|
1411
1417
|
* @public
|
|
1412
|
-
*
|
|
1413
|
-
* it should emit the index of the quality to set
|
|
1414
|
-
* -1 is a special idx saying to use ABR if the plugin
|
|
1415
|
-
* exposes an ABR implementation
|
|
1418
|
+
* @deprecated please use Qsel.events.SET_QUALITY
|
|
1416
1419
|
*/
|
|
1417
1420
|
declare const /**
|
|
1418
1421
|
@public
|
|
1419
1422
|
* when a new player is inserted into the HTML
|
|
1420
1423
|
*/ /**
|
|
1421
1424
|
* @public
|
|
1422
|
-
*
|
|
1423
|
-
* it should emit the index of the quality to set
|
|
1424
|
-
* -1 is a special idx saying to use ABR if the plugin
|
|
1425
|
-
* exposes an ABR implementation
|
|
1425
|
+
* @deprecated please use Qsel.events.SET_QUALITY
|
|
1426
1426
|
*/
|
|
1427
1427
|
SET_QUALITY = "quality:set";
|
|
1428
1428
|
|
|
@@ -1615,16 +1615,6 @@ declare const /**
|
|
|
1615
1615
|
*/
|
|
1616
1616
|
VIDEO_TRACKS = "videoTracks";
|
|
1617
1617
|
|
|
1618
|
-
/**
|
|
1619
|
-
* @public
|
|
1620
|
-
*/
|
|
1621
|
-
declare interface VideoTrack {
|
|
1622
|
-
name: string;
|
|
1623
|
-
/* Excluded from this release type: data */
|
|
1624
|
-
default: boolean;
|
|
1625
|
-
selected: boolean;
|
|
1626
|
-
}
|
|
1627
|
-
|
|
1628
1618
|
/**
|
|
1629
1619
|
* @public
|
|
1630
1620
|
* when a player enters the viewpoint
|
|
@@ -1685,6 +1675,12 @@ declare const /**
|
|
|
1685
1675
|
*/
|
|
1686
1676
|
WAITING_2 = "waiting";
|
|
1687
1677
|
|
|
1678
|
+
/**
|
|
1679
|
+
* this event is reported to the insights service at fixed intervals to keep
|
|
1680
|
+
* a running tally of how much video has been watched during a view by a user
|
|
1681
|
+
*/
|
|
1682
|
+
declare const WATCHED_INTERVAL = "insights:watched_interval";
|
|
1683
|
+
|
|
1688
1684
|
/* Excluded from this release type: WEBKIT_NEEDKEY */
|
|
1689
1685
|
|
|
1690
1686
|
declare const WILL_PAUSE = "will-pause";
|
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 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)}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):((t="undefined"!=typeof globalThis?globalThis:t||self).flowplayer=t.flowplayer||{},t.flowplayer.health=e())}(this,(function(){"use strict";const t="rebuffer",e="rebuffer:ended",i="insights:ttff",n="insights:time_to_first_frag_loaded",s="insights:watched_interval";var a=Object.freeze({__proto__:null,RECORD:"health:record",REBUFFER:t,REBUFFER_ENDED:e,DISPLAY:"display",TIME_TO_FIRST_FRAME:i,TIME_TO_FIRST_FRAGMENT_LOADED:n,WATCHED_INTERVAL:s});const r="fullscreenenter",o="fullscreenexit",d="loadedmetadata",c="loadeddata",l="progress",h="loadstart",u="pause",_="playing",p="waiting",m="canplay",f="ended",y="seeked",g="seeking",v="content:loadstart",E=[v,"error","src"];function T(t){try{return!!new URL(t)}catch(t){return!1}}function S(t,e){const i=function(){try{return localStorage.getItem("flowplayer/debug")}catch(t){return""}}(),n=(n,...s)=>{try{const a=(null==e?void 0:e.debug)||i;a&&t.match(a)&&console.log(`flowplayer/${t} -- ${n}`,...s)}catch(t){console.warn(t)}};return n.log=n,n}const R=navigator;function w(t){var e,i;const n=null===(e=t.hls)||void 0===e?void 0:e.bandwidthEstimate;return n?1e-6*n:(null===(i=R.connection)||void 0===i?void 0:i.downlink)||-1}function A(t,e){return async function(t,e){try{await fetch(t,{body:e,method:"POST",mode:"no-cors"})}catch(t){}}(t,JSON.stringify({events:e}))}var I;!function(t){t[t.OFF=0]="OFF",t[t.ON=1]="ON",t[t.AUDIO_REQUIRED=2]="AUDIO_REQUIRED"}(I||(I={}));const O=t=>{switch(t){case!0:return I.ON;case!1:return I.OFF;default:return t}};function W(){try{const t=window.location!==window.parent.location?document.referrer:document.location.href;return"string"==typeof t&&t.slice(0,200)}catch(t){return!1}}const D=[],N="https://ihi.flowplayer.com/v1/health/events";function b(t){if(t.suspended)return;const e=D.slice(0);D.length=0,0!=e.length&&(t.logger.log(`:dispatch events={${e.length}}`),A(function(){try{return"undefined"==typeof window?N:window.__FLOWPLAYER_INSIGHTS_URL?window.__FLOWPLAYER_INSIGHTS_URL:N}catch(t){return N}}(),e))}async function M(t,e,i){const n=await C();D.push(Object.assign(e,n)),t.logger.log(":enqueue",e.event,e),D.length<10&&!i||b(t)}const U=()=>{var t,e;try{const i=window;return null===(e=null===(t=null==i?void 0:i.google)||void 0===t?void 0:t.ima)||void 0===e?void 0:e.VERSION}catch(t){return}},C=async()=>({client_time:Date.now()}),F=(t,e)=>Object.assign(t,{detail:e}),L=(t,{event:e,media_session_id:i,session_id:n,play_range_id:s})=>({event:e,media_session_id:i,session_id:n,play_range_id:s,device_id:t.deviceId(),version:"3.16.0-rc.2",commit:"27f9251253e8b5e5c0cc5620de5dbff57a3ac05e",ima_sdk_version:U(),preload:t.opt("preload"),autoplay:O(t.opt("autoplay")),live:t.opt("live"),dvr:!!t.live_state.dvr,source:t.original_src,downlink_mbs:w(t),page_url:W(),player_id:t.opt("metadata.player_id"),media_id:t.opt("metadata.media_id"),site_id:t.opt("metadata.site_id"),category_id:t.opt("metadata.category_id"),sitegroup_id:t.opt("metadata.sitegroup_id"),token:t.token,plugins:t.plugins.map(t=>t.constructor.name).sort((t,e)=>t.localeCompare(e)),current_time:t.currentTime,external_media_id:t.opt("external_media_id")}),P=t=>({bitrate:null==t?void 0:t.bitrate,resolution:null==t?void 0:t.attrs.RESOLUTION,frame_rate:null==t?void 0:t.attrs["FRAME-RATE"]});function k(t,e,i,n){const s=L(e,t.eventInfo(i)),{before:a,after:r}=n;M(t,((t,e,i)=>Object.assign(t,{state:{before:e,after:i}}))(s,P(a),P(r)))}const x=[1e7]+""+-1e3+-4e3+-8e3+-1e11,B=()=>"undefined"==typeof crypto?"":x.replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16));var H;function G(t){switch(t){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(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.MEDIA_PLAYBACK_ABORTED=1]="MEDIA_PLAYBACK_ABORTED",t[t.MEDIA_ERR_NETWORK=2]="MEDIA_ERR_NETWORK",t[t.MEDIA_ERR_DECODE=3]="MEDIA_ERR_DECODE",t[t.MEDIA_ERR_SRC_NOT_SUPPORTED=4]="MEDIA_ERR_SRC_NOT_SUPPORTED",t[t.MIXED_CONTENT=1001]="MIXED_CONTENT",t[t.NO_INTERNET=1002]="NO_INTERNET"}(H||(H={}));const j=(t,e)=>{let i=null;return(...n)=>{null!==i&&(clearTimeout(i),i=null),i=setTimeout(()=>e(...n),t)}};var K;!function(t){t[t.Starting=0]="Starting",t[t.ConfigFinalized=1]="ConfigFinalized",t[t.TimerStartedWithAdsAutoplay=2]="TimerStartedWithAdsAutoplay",t[t.TimerStartedWithContentAutoplay=3]="TimerStartedWithContentAutoplay",t[t.TimerStartedWithUserGesture=4]="TimerStartedWithUserGesture",t[t.MetricReported=5]="MetricReported"}(K||(K={}));class TimeToFirstFrame{constructor(t=K.Starting,e=!1,i=!1){this.state=t,this.loadedAd=e,this.requiresUserGesture=i}reset(){this.state=K.Starting,this.loadedAd=!1,this.elapsed=void 0}toJSON(){var t;return{ad_was_requested:this.loadedAd,ms_to_first_frame:Math.round((null===(t=this.elapsed)||void 0===t?void 0:t.duration)||-1)}}startTimer(t){this.state==K.ConfigFinalized&&(this.state=t,performance.mark("ttff:start"))}hasStarted(){return[K.TimerStartedWithAdsAutoplay,K.TimerStartedWithContentAutoplay,K.TimerStartedWithUserGesture].includes(this.state)}stopTimer(t){if(this.hasStarted()){performance.mark("ttff:end");const e=this.elapsed=performance.measure("ttff","ttff:start","ttff:end");this.state=K.MetricReported,t(e)}}}function z(t){return Math.round(1e3*t)/1e3}class WatchedState{constructor(t){this.player=t,this.marchingInterval=void 0,this.lastWatchedPoint=void 0,this.watchedSum=0,this.lastReportedSum=0}reset(){this.onNotWatching(),this.watchedSum=0,this.lastReportedSum=0,this.lastWatchedPoint=void 0}onNotWatching(){this.marchingInterval&&(this.updateWatched(),this.marchingInterval=clearInterval(this.marchingInterval))}onWatching(){this.marchingInterval||(this.lastWatchedPoint=this.createWatchedPoint(),this.marchingInterval=setInterval(()=>{this.updateWatched()},WatchedState.AccuracyMilliseconds))}createWatchedPoint(){return{currentTime:this.player.currentTime,paused:this.player.paused}}updateWatched(){const t=this.createWatchedPoint();this.lastWatchedPoint&&this.calculateTimeWatched(this.lastWatchedPoint,t),this.lastWatchedPoint=t}calculateTimeWatched(t,e){const i=e.currentTime-t.currentTime;if(!(i<0)&&!(1e3*i>1.3*WatchedState.AccuracyMilliseconds)&&(this.watchedSum+=i,this.watchedSum!=this.lastReportedSum&&(this.watchedSum>this.lastReportedSum+WatchedState.ReportingIntervalSeconds||this.player.ended))){const t={total_watched_seconds:z(this.watchedSum),tick_watched_seconds:z(i),batch_watched_seconds:z(this.watchedSum-this.lastReportedSum)};this.lastReportedSum=this.watchedSum,this.player.emit(s,t)}}}WatchedState.ReportingIntervalSeconds=5,WatchedState.AccuracyMilliseconds=160;const q=B();class Health{constructor(t,e){let i;this.session_id=q,this.suspended=!1,this.logger=S("health",e.opts),this.media_session_id=B(),this.play_range_id=B(),this.analyticsLoop=setInterval(()=>b(this),2e3),e.on("reap",()=>clearInterval(this.analyticsLoop)),e.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;e.on("timeupdate",t=>{if(i!==this.media_session_id)return;const s=Date.now();if(s<n)return;n=Date.now()+5e3;const a=L(e,this.eventInfo(t.type)),r=F(a,{duration:(o=e.duration,Number.isFinite(o)?o:o===1/0?-1:void 0)});var o;this.first_playing_event_timestamp&&(Object.assign(r,{ms_since_first_playing:s-this.first_playing_event_timestamp}),this.first_playing_event_timestamp=void 0),M(this,r)});const s=this;if(e.health={get media_session_id(){return s.media_session_id},set media_session_id(t){s.media_session_id=t},get session_id(){return s.session_id},set session_id(t){s.session_id=t},toggle(t){t?s.resume():s.suspend()}},!Health._UNLOAD_SUBSCRIBED){Health._UNLOAD_SUBSCRIBED=!0;const e=e=>t.instances.forEach(t=>t.emit(e.type));document.addEventListener("visibilitychange",t=>{"hidden"==document.visibilityState&&e(t)}),window.addEventListener("pagehide",e)}}eventInfo(t){return{event:t,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(()=>b(this),2e3)}init(a,S,R){if(W().toString().startsWith("data:"))return this.suspend();!function(i){let n=null;const s=()=>{n=null};i.on(p,(function(e){i.seeking||i.networkState===i.NETWORK_LOADING&&(i.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||i.emit(t))})),i.on(t,t=>{n=t}),i.on(m,t=>{if(n){const a=t.timeStamp-n.timeStamp;if(s(),a<31)return;if(a>3e5)return;i.emit(e,{rebuffer_duration:a/1e3})}}),E.forEach(t=>i.on(t,s))}(R),function(t){let e;[m,v].forEach(i=>{t.on(i,i=>{const s=Date.now();switch(i.type){case v:return e=s;case m:if(e)return t.emit(n,{ms_since_loading_started:s-e}),e=null}})})}(R),function(t){if(void 0===window.performance)return;const e=new TimeToFirstFrame;t.on("ovp:config:finalized",t=>{e.reset(),e.state=K.ConfigFinalized,e.requiresUserGesture=!t.detail.autoplay}),t.on(v,()=>{t.root.classList.contains("ad-hide-first-frame")&&e.startTimer(K.TimerStartedWithAdsAutoplay),t.opt("autoplay")&&e.startTimer(K.TimerStartedWithContentAutoplay)}),t.on("click",()=>{t.opt("autoplay")||e.startTimer(K.TimerStartedWithUserGesture)}),t.on("ad-requested",()=>{e.loadedAd=!0}),t.on("timeupdate",()=>{if(!(t.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))switch(e.state){case K.TimerStartedWithContentAutoplay:case K.TimerStartedWithUserGesture:return e.stopTimer(()=>t.emit(i,e.toJSON()))}}),t.on("ad-started",()=>{switch(e.state){case K.TimerStartedWithAdsAutoplay:case K.TimerStartedWithUserGesture:return e.stopTimer(()=>t.emit(i,e.toJSON()))}})}(R),function(t){const e=new WatchedState(t);t.on(v,()=>e.reset()),t.on(_,()=>e.onWatching()),t.on(u,()=>e.onNotWatching()),t.on(g,()=>e.onNotWatching()),t.on(f,()=>e.updateWatched()),t.on("visibilitychange",()=>e.updateWatched())}(R),R.on("display",t=>{M(this,L(R,this.eventInfo(t.type)),!0)}),R.on("health:record",({detail:t})=>{const e=L(R,this.eventInfo(t.event));Object.assign(e,t.detail||{}),M(this,e)}),[h,d,c,l,p,t].forEach(t=>{R.on(t,t=>{M(this,L(R,this.eventInfo(t.type)))})}),[e,i,n,s].forEach(t=>{R.on(t,t=>{const e=L(R,this.eventInfo(t.type));M(this,Object.assign(e,t.detail))})}),[_,u,g,y,f,r,o,m,v].forEach(t=>{R.on(t,t=>{M(this,L(R,this.eventInfo(t.type)))})}),R.on("volumechange",j(800,t=>{const e=L(R,this.eventInfo(t.type));M(this,F(e,{volume:parseFloat(R.volume.toFixed(2)),muted:R.muted}))})),R.on("resize",j(800,t=>{const e=L(R,this.eventInfo(t.type));M(this,F(e,{height:S.clientHeight,width:S.clientWidth}))})),R.on("hls/failover",t=>{const e=L(R,this.eventInfo(t.type)),i=t.detail,{reason:n,from:s}=i;M(this,F(e,{reason:n,from:s}))}),R.on("qualitychange",({type:t,detail:e})=>{switch(e.kind){case"hls":return k(this,R,t,e)}}),R.addEventListener("error",t=>{const e=L(R,this.eventInfo(t.type)),i=t.error||R.error;if(!i)return M(this,e,!0);const n=i.code,s={error_message:i.message||G(n),error_code:n,error_stack:i.stack||""};return M(this,F(e,s),!0)}),R.on("src",t=>{var e;const i=null===(e=t.detail)||void 0===e?void 0:e.src;if("string"!=typeof i)return;if(!T(R.original_src))return;if(!T(i))return;if(i==R.original_src)return;this.media_session_id=B();M(this,L(R,this.eventInfo(t.type))),b(this)}),R.on("visibilitychange",t=>{M(this,L(R,this.eventInfo(t.type))),b(this)})}}return Health.events=a,Health._UNLOAD_SUBSCRIBED=!1,function(t,e){if("object"==typeof exports&&"undefined"!=typeof module)return e;if(null===document.currentScript)return e;"flowplayer"in t||(t.flowplayer={extensions:[]});const i=t.flowplayer;return"function"==typeof i?(i(e),e):(Array.isArray(i.extensions)||(i.extensions=[]),~i.extensions.indexOf(e)||i.extensions.push(e),e)}(window,Health)}));
|
package/plugins/hls.d.ts
CHANGED
|
@@ -823,6 +823,8 @@ declare const NO_CONTROLS = "no-controls";
|
|
|
823
823
|
|
|
824
824
|
declare const NO_DVR = "no-timeline";
|
|
825
825
|
|
|
826
|
+
declare type NoInfer_2<T> = [T][T extends any ? 0 : never];
|
|
827
|
+
|
|
826
828
|
/* Excluded from this release type: NON_RECOVERABLE_ERROR */
|
|
827
829
|
|
|
828
830
|
/* Excluded from this release type: NonRecoverableErrorEventDetail */
|
|
@@ -963,7 +965,6 @@ declare type Player = HTMLVideoElement & PlayerEventOverloads & {
|
|
|
963
965
|
disabled: boolean;
|
|
964
966
|
/* Excluded from this release type: started */
|
|
965
967
|
/* Excluded from this release type: token */
|
|
966
|
-
tracks?: VideoTrack[];
|
|
967
968
|
/* Excluded from this release type: _customElements */
|
|
968
969
|
/* Excluded from this release type: _storage */
|
|
969
970
|
};
|
|
@@ -1047,6 +1048,7 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1047
1048
|
*/
|
|
1048
1049
|
on(event: typeof QUALITIES, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof QUALITIES]>) => void): Player;
|
|
1049
1050
|
/* Excluded from this release type: on */
|
|
1051
|
+
/* Excluded from this release type: on */
|
|
1050
1052
|
/**
|
|
1051
1053
|
* Listen to this event to create a recommendations grid using the data passed with the event.
|
|
1052
1054
|
*/
|
|
@@ -1065,6 +1067,11 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1065
1067
|
/* Excluded from this release type: on */
|
|
1066
1068
|
/* Excluded from this release type: on */
|
|
1067
1069
|
/* Excluded from this release type: on */
|
|
1070
|
+
/* Excluded from this release type: on */
|
|
1071
|
+
/**
|
|
1072
|
+
* TODO: this is a workaround, since not all event overloads are typed. when all plugin work is finished, remove this
|
|
1073
|
+
* https://wowzamedia.jira.com/browse/PLAY-653
|
|
1074
|
+
*/
|
|
1068
1075
|
on<T>(event: string, handler: (e: FPEvent<T>) => void): Player;
|
|
1069
1076
|
/* Excluded from this release type: on */
|
|
1070
1077
|
/**
|
|
@@ -1089,9 +1096,12 @@ declare type PlayerCustomEventsOverloads = {
|
|
|
1089
1096
|
*/
|
|
1090
1097
|
off<T>(event: string, handler: (e: FPEvent<T>) => void): Player;
|
|
1091
1098
|
/* Excluded from this release type: poll */
|
|
1099
|
+
emit<T extends PlayerEmittableEventNames>(event: T, data?: PlayerCustomEventsDetailMap[T]): Player;
|
|
1100
|
+
emit(event: never, data?: never): Player;
|
|
1101
|
+
/* Excluded from this release type: emit */
|
|
1102
|
+
/* Excluded from this release type: emit */
|
|
1092
1103
|
/* Excluded from this release type: emit */
|
|
1093
1104
|
/* Excluded from this release type: emit */
|
|
1094
|
-
emit<T extends PlayerEmittableEventNames>(event: T, data?: PlayerCustomEventsDetailMap[T]): Player;
|
|
1095
1105
|
/* Excluded from this release type: emit */
|
|
1096
1106
|
};
|
|
1097
1107
|
|
|
@@ -1199,6 +1209,17 @@ declare const /**
|
|
|
1199
1209
|
*/
|
|
1200
1210
|
PROGRESS = "progress";
|
|
1201
1211
|
|
|
1212
|
+
/**
|
|
1213
|
+
* @public
|
|
1214
|
+
*/
|
|
1215
|
+
declare type QselOption = {
|
|
1216
|
+
height: number;
|
|
1217
|
+
level: number;
|
|
1218
|
+
text: string;
|
|
1219
|
+
/* Excluded from this release type: videoCodec */
|
|
1220
|
+
width: number;
|
|
1221
|
+
};
|
|
1222
|
+
|
|
1202
1223
|
/**
|
|
1203
1224
|
* @public
|
|
1204
1225
|
* emitted whenever a list of qualities has been made available
|
|
@@ -1217,27 +1238,11 @@ QUALITIES = "qualities";
|
|
|
1217
1238
|
/**
|
|
1218
1239
|
* @public
|
|
1219
1240
|
*/
|
|
1220
|
-
declare type QualitiesEventDetail =
|
|
1241
|
+
declare type QualitiesEventDetail = QselOption[];
|
|
1221
1242
|
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
*/
|
|
1225
|
-
declare type QualityDetail = {
|
|
1226
|
-
level: number;
|
|
1227
|
-
text: string;
|
|
1228
|
-
width: number;
|
|
1229
|
-
height: number;
|
|
1230
|
-
videoCodec: string;
|
|
1231
|
-
} | BitrateInfo | {
|
|
1232
|
-
text: string | number;
|
|
1233
|
-
encodingId: string;
|
|
1234
|
-
spatialLayerId: number;
|
|
1235
|
-
temporalLayerId: number;
|
|
1236
|
-
maxSpatialLayerId: number;
|
|
1237
|
-
maxTemporalLayerId: number;
|
|
1238
|
-
height: number;
|
|
1239
|
-
width: number;
|
|
1240
|
-
};
|
|
1243
|
+
/* Excluded from this release type: _QualitiesEventDetail */
|
|
1244
|
+
|
|
1245
|
+
/* Excluded from this release type: _QualityDetail */
|
|
1241
1246
|
|
|
1242
1247
|
declare enum QualityOpts {
|
|
1243
1248
|
LOW = 1,
|
|
@@ -1414,20 +1419,14 @@ SEEKING_2 = "seeking";
|
|
|
1414
1419
|
|
|
1415
1420
|
/**
|
|
1416
1421
|
* @public
|
|
1417
|
-
*
|
|
1418
|
-
* it should emit the index of the quality to set
|
|
1419
|
-
* -1 is a special idx saying to use ABR if the plugin
|
|
1420
|
-
* exposes an ABR implementation
|
|
1422
|
+
* @deprecated please use Qsel.events.SET_QUALITY
|
|
1421
1423
|
*/
|
|
1422
1424
|
declare const /**
|
|
1423
1425
|
@public
|
|
1424
1426
|
* when a new player is inserted into the HTML
|
|
1425
1427
|
*/ /**
|
|
1426
1428
|
* @public
|
|
1427
|
-
*
|
|
1428
|
-
* it should emit the index of the quality to set
|
|
1429
|
-
* -1 is a special idx saying to use ABR if the plugin
|
|
1430
|
-
* exposes an ABR implementation
|
|
1429
|
+
* @deprecated please use Qsel.events.SET_QUALITY
|
|
1431
1430
|
*/
|
|
1432
1431
|
SET_QUALITY = "quality:set";
|
|
1433
1432
|
|
|
@@ -1616,16 +1615,6 @@ declare const /**
|
|
|
1616
1615
|
*/
|
|
1617
1616
|
VIDEO_TRACKS = "videoTracks";
|
|
1618
1617
|
|
|
1619
|
-
/**
|
|
1620
|
-
* @public
|
|
1621
|
-
*/
|
|
1622
|
-
declare interface VideoTrack {
|
|
1623
|
-
name: string;
|
|
1624
|
-
/* Excluded from this release type: data */
|
|
1625
|
-
default: boolean;
|
|
1626
|
-
selected: boolean;
|
|
1627
|
-
}
|
|
1628
|
-
|
|
1629
1618
|
/**
|
|
1630
1619
|
* @public
|
|
1631
1620
|
* when a player enters the viewpoint
|