@gcorevideo/player 2.19.15 → 2.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/level-selector/list.ejs +1 -1
- package/dist/core.js +2 -2
- package/dist/index.css +1634 -1634
- package/dist/index.js +585 -416
- package/dist/player.d.ts +268 -72
- package/dist/plugins/index.css +1567 -1567
- package/dist/plugins/index.js +526 -357
- package/docs/api/player.clapprnerdstats.md +12 -259
- package/docs/api/player.dvrcontrols.md +5 -1
- package/docs/api/player.errorscreen.attributes.md +3 -0
- package/docs/api/player.errorscreen.bindevents.md +3 -0
- package/docs/api/player.errorscreen.container.md +3 -0
- package/docs/api/player.errorscreen.hide.md +3 -0
- package/docs/api/player.errorscreen.md +27 -0
- package/docs/api/player.errorscreen.name.md +3 -0
- package/docs/api/player.errorscreen.render.md +3 -0
- package/docs/api/player.errorscreen.show.md +3 -0
- package/docs/api/player.errorscreen.supportedversion.md +3 -0
- package/docs/api/player.errorscreen.template.md +3 -0
- package/docs/api/player.errorscreen.unbindevents.md +3 -0
- package/docs/api/{player.playbackrate.template.md → player.initeventdata.event.md} +3 -3
- package/docs/api/{player.playbackrate.updateplaybackrate.md → player.initeventdata.md} +15 -11
- package/docs/api/player.md +88 -5
- package/docs/api/player.pictureinpicture.md +9 -197
- package/docs/api/player.playbackrate.md +10 -314
- package/docs/api/{player.playbackrate.onplay.md → player.stalleventdata.count.md} +5 -7
- package/docs/api/{player.playbackrate.name.md → player.stalleventdata.event.md} +3 -3
- package/docs/api/player.stalleventdata.md +112 -0
- package/docs/api/player.stalleventdata.time.md +13 -0
- package/docs/api/player.stalleventdata.total_ms.md +13 -0
- package/docs/api/{player.pluginsettings.md → player.starteventdata.event.md} +3 -5
- package/docs/api/{player.playbackrate.onrateselect.md → player.starteventdata.md} +15 -11
- package/docs/api/{player.statistics._constructor_.md → player.telemetry._constructor_.md} +6 -3
- package/docs/api/player.telemetry.md +146 -0
- package/docs/api/{player.volumefade.name.md → player.telemetry.name.md} +4 -2
- package/docs/api/{player.clapprnerdstats.supportedversion.md → player.telemetry.supportedversion.md} +4 -2
- package/docs/api/player.telemetryevent.md +89 -0
- package/docs/api/player.telemetryeventdata.md +15 -0
- package/docs/api/player.telemetrypluginsettings.md +57 -0
- package/docs/api/player.telemetrypluginsettings.send.md +13 -0
- package/docs/api/player.telemetryrecord.md +17 -0
- package/docs/api/player.volumefade.md +0 -93
- package/docs/api/{player.pictureinpicture.name.md → player.watcheventdata.event.md} +3 -3
- package/docs/api/{player.playbackrate.setselectedrate.md → player.watcheventdata.md} +15 -11
- package/lib/index.plugins.d.ts +2 -2
- package/lib/index.plugins.d.ts.map +1 -1
- package/lib/index.plugins.js +2 -2
- package/lib/playback/hls-playback/HlsPlayback.js +1 -1
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts +38 -5
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.d.ts.map +1 -1
- package/lib/plugins/clappr-nerd-stats/ClapprNerdStats.js +63 -17
- package/lib/plugins/dvr-controls/DvrControls.d.ts +5 -2
- package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -1
- package/lib/plugins/dvr-controls/DvrControls.js +5 -2
- package/lib/plugins/error-screen/ErrorScreen.d.ts +5 -0
- package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -1
- package/lib/plugins/error-screen/ErrorScreen.js +5 -0
- package/lib/plugins/index.d.ts +2 -3
- package/lib/plugins/index.d.ts.map +1 -1
- package/lib/plugins/index.js +2 -3
- package/lib/plugins/picture-in-picture/PictureInPicture.d.ts +32 -4
- package/lib/plugins/picture-in-picture/PictureInPicture.d.ts.map +1 -1
- package/lib/plugins/picture-in-picture/PictureInPicture.js +30 -2
- package/lib/plugins/playback-rate/PlaybackRate.d.ts +47 -14
- package/lib/plugins/playback-rate/PlaybackRate.d.ts.map +1 -1
- package/lib/plugins/playback-rate/PlaybackRate.js +38 -9
- package/lib/plugins/statistics/Statistics.d.ts +38 -3
- package/lib/plugins/statistics/Statistics.d.ts.map +1 -1
- package/lib/plugins/statistics/Statistics.js +51 -9
- package/lib/plugins/telemetry/Telemetry.d.ts +135 -0
- package/lib/plugins/telemetry/Telemetry.d.ts.map +1 -0
- package/lib/plugins/telemetry/Telemetry.js +180 -0
- package/lib/plugins/volume-fade/VolumeFade.d.ts +7 -1
- package/lib/plugins/volume-fade/VolumeFade.d.ts.map +1 -1
- package/lib/plugins/volume-fade/VolumeFade.js +8 -1
- package/package.json +1 -1
- package/src/index.plugins.ts +2 -2
- package/src/playback/hls-playback/HlsPlayback.ts +1 -1
- package/src/plugins/clappr-nerd-stats/ClapprNerdStats.ts +240 -173
- package/src/plugins/dvr-controls/DvrControls.ts +5 -2
- package/src/plugins/error-screen/ErrorScreen.ts +5 -0
- package/src/plugins/index.ts +2 -3
- package/src/plugins/level-selector/__tests__/LevelSelector.test.ts +47 -26
- package/src/plugins/level-selector/__tests__/__snapshots__/LevelSelector.test.ts.snap +18 -18
- package/src/plugins/picture-in-picture/PictureInPicture.ts +35 -7
- package/src/plugins/playback-rate/PlaybackRate.ts +53 -24
- package/src/plugins/telemetry/Telemetry.ts +299 -0
- package/src/plugins/volume-fade/VolumeFade.ts +9 -2
- package/temp/player.api.json +2322 -3281
- package/tsconfig.tsbuildinfo +1 -1
- package/docs/api/player.clapprnerdstats.attributes.md +0 -17
- package/docs/api/player.clapprnerdstats.bindevents.md +0 -18
- package/docs/api/player.clapprnerdstats.events.md +0 -18
- package/docs/api/player.clapprnerdstats.name.md +0 -14
- package/docs/api/player.clapprnerdstats.playerheight.md +0 -14
- package/docs/api/player.clapprnerdstats.playerwidth.md +0 -14
- package/docs/api/player.clapprnerdstats.render.md +0 -18
- package/docs/api/player.clapprnerdstats.statsboxelem.md +0 -14
- package/docs/api/player.clapprnerdstats.statsboxwidththreshold.md +0 -14
- package/docs/api/player.clapprnerdstats.template.md +0 -14
- package/docs/api/player.pictureinpicture.bindevents.md +0 -15
- package/docs/api/player.pictureinpicture.events.md +0 -13
- package/docs/api/player.pictureinpicture.exitpictureinpicture.md +0 -15
- package/docs/api/player.pictureinpicture.render.md +0 -15
- package/docs/api/player.pictureinpicture.requestpictureinpicture.md +0 -15
- package/docs/api/player.pictureinpicture.supportedversion.md +0 -13
- package/docs/api/player.pictureinpicture.togglepictureinpicture.md +0 -15
- package/docs/api/player.pictureinpicture.version.md +0 -11
- package/docs/api/player.pictureinpicture.videoelement.md +0 -11
- package/docs/api/player.playbackrate.attributes.md +0 -14
- package/docs/api/player.playbackrate.bindevents.md +0 -15
- package/docs/api/player.playbackrate.events.md +0 -15
- package/docs/api/player.playbackrate.gettitle.md +0 -15
- package/docs/api/player.playbackrate.goback.md +0 -15
- package/docs/api/player.playbackrate.highlightcurrentrate.md +0 -15
- package/docs/api/player.playbackrate.onfinishad.md +0 -15
- package/docs/api/player.playbackrate.onshowmenu.md +0 -15
- package/docs/api/player.playbackrate.onstartad.md +0 -15
- package/docs/api/player.playbackrate.onstop.md +0 -15
- package/docs/api/player.playbackrate.reload.md +0 -15
- package/docs/api/player.playbackrate.render.md +0 -15
- package/docs/api/player.playbackrate.supportedversion.md +0 -13
- package/docs/api/player.playbackrate.unbindevents.md +0 -15
- package/docs/api/player.statistics.bindevents.md +0 -15
- package/docs/api/player.statistics.md +0 -141
- package/docs/api/player.statistics.name.md +0 -11
- package/docs/api/player.statistics.supportedversion.md +0 -13
- package/docs/api/player.volumefade.bindevents.md +0 -18
- package/docs/api/player.volumefade.unbindevents.md +0 -18
- package/src/plugins/statistics/Statistics.ts +0 -207
- /package/src/plugins/{statistics → telemetry}/Statistics copy.xts +0 -0
package/dist/player.d.ts
CHANGED
|
@@ -183,7 +183,22 @@ export declare class BottomGear extends UICorePlugin {
|
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
/**
|
|
186
|
+
* Displays useful network-related statistics.
|
|
186
187
|
* @beta
|
|
188
|
+
*
|
|
189
|
+
* @remarks
|
|
190
|
+
* Depends on:
|
|
191
|
+
*
|
|
192
|
+
* - {@link MediaControl}
|
|
193
|
+
*
|
|
194
|
+
* - {@link BottomGear}
|
|
195
|
+
*
|
|
196
|
+
* - {@link ClapprStats}
|
|
197
|
+
*
|
|
198
|
+
* The plugin is rendered as an item in the gear menu.
|
|
199
|
+
*
|
|
200
|
+
* When clicked, it shows an overlay window with the information about the network speed, latency, etc,
|
|
201
|
+
* and recommended quality level.
|
|
187
202
|
*/
|
|
188
203
|
export declare class ClapprNerdStats extends UICorePlugin {
|
|
189
204
|
private container;
|
|
@@ -192,25 +207,40 @@ export declare class ClapprNerdStats extends UICorePlugin {
|
|
|
192
207
|
private showing;
|
|
193
208
|
private shortcut;
|
|
194
209
|
private iconPosition;
|
|
210
|
+
/**
|
|
211
|
+
* @internal
|
|
212
|
+
*/
|
|
195
213
|
get name(): string;
|
|
214
|
+
/**
|
|
215
|
+
* @internal
|
|
216
|
+
*/
|
|
196
217
|
get supportedVersion(): {
|
|
197
218
|
min: string;
|
|
198
219
|
};
|
|
199
|
-
|
|
220
|
+
private static readonly template;
|
|
221
|
+
/**
|
|
222
|
+
* @internal
|
|
223
|
+
*/
|
|
200
224
|
get attributes(): {
|
|
201
225
|
'data-clappr-nerd-stats': string;
|
|
202
226
|
class: string;
|
|
203
227
|
};
|
|
228
|
+
/**
|
|
229
|
+
* @internal
|
|
230
|
+
*/
|
|
204
231
|
get events(): {
|
|
205
232
|
'click [data-show-stats-button]': string;
|
|
206
233
|
'click [data-close-button]': string;
|
|
207
234
|
'click [data-refresh-button]': string;
|
|
208
235
|
};
|
|
209
|
-
get statsBoxElem()
|
|
210
|
-
get statsBoxWidthThreshold()
|
|
211
|
-
get playerWidth()
|
|
212
|
-
get playerHeight()
|
|
236
|
+
private get statsBoxElem();
|
|
237
|
+
private get statsBoxWidthThreshold();
|
|
238
|
+
private get playerWidth();
|
|
239
|
+
private get playerHeight();
|
|
213
240
|
constructor(core: Core);
|
|
241
|
+
/**
|
|
242
|
+
* @internal
|
|
243
|
+
*/
|
|
214
244
|
bindEvents(): void;
|
|
215
245
|
private init;
|
|
216
246
|
private toggle;
|
|
@@ -221,6 +251,9 @@ export declare class ClapprNerdStats extends UICorePlugin {
|
|
|
221
251
|
private addCustomMetrics;
|
|
222
252
|
private updateMetrics;
|
|
223
253
|
private setStatsBoxSize;
|
|
254
|
+
/**
|
|
255
|
+
* @internal
|
|
256
|
+
*/
|
|
224
257
|
render(): this;
|
|
225
258
|
private addToBottomGear;
|
|
226
259
|
private clearCustomMetrics;
|
|
@@ -391,8 +424,11 @@ export declare class DisableControls extends UICorePlugin {
|
|
|
391
424
|
* @beta
|
|
392
425
|
*
|
|
393
426
|
* @remarks
|
|
394
|
-
*
|
|
395
|
-
*
|
|
427
|
+
* Depends on:
|
|
428
|
+
*
|
|
429
|
+
* - {@link MediaControl | media_control}
|
|
430
|
+
*
|
|
431
|
+
* The plugin renders the live stream indicator and the DVR seek bar, if DVR is enabled, in the media control UI.
|
|
396
432
|
*/
|
|
397
433
|
export declare class DvrControls extends UICorePlugin {
|
|
398
434
|
private static readonly template;
|
|
@@ -443,6 +479,11 @@ export declare class DvrControls extends UICorePlugin {
|
|
|
443
479
|
*/
|
|
444
480
|
export declare type ErrorLevel = 'FATAL' | 'WARN' | 'INFO';
|
|
445
481
|
|
|
482
|
+
/**
|
|
483
|
+
* Displays a descriptive error in the overlay on top of the player.
|
|
484
|
+
* @beta
|
|
485
|
+
* TODO
|
|
486
|
+
*/
|
|
446
487
|
export declare class ErrorScreen extends UICorePlugin {
|
|
447
488
|
private _retry;
|
|
448
489
|
private err;
|
|
@@ -545,6 +586,10 @@ export declare class GoogleAnalytics extends ContainerPlugin {
|
|
|
545
586
|
push(array: string[]): void;
|
|
546
587
|
}
|
|
547
588
|
|
|
589
|
+
export declare interface InitEventData {
|
|
590
|
+
event: TelemetryEvent.Init;
|
|
591
|
+
}
|
|
592
|
+
|
|
548
593
|
declare type KeyboardEventHandler = (e: KeyboardEvent) => boolean | undefined;
|
|
549
594
|
|
|
550
595
|
/**
|
|
@@ -1077,22 +1122,50 @@ export declare class MultiCamera extends UICorePlugin {
|
|
|
1077
1122
|
private highlightCurrentLevel;
|
|
1078
1123
|
}
|
|
1079
1124
|
|
|
1125
|
+
/**
|
|
1126
|
+
* Enables picture in picture mode.
|
|
1127
|
+
* @beta
|
|
1128
|
+
* @remarks
|
|
1129
|
+
* Depends on:
|
|
1130
|
+
*
|
|
1131
|
+
* - {@link MediaControl}
|
|
1132
|
+
*
|
|
1133
|
+
* It renders a button to toggle picture in picture mode in the media control UI.
|
|
1134
|
+
*/
|
|
1080
1135
|
export declare class PictureInPicture extends UICorePlugin {
|
|
1136
|
+
/**
|
|
1137
|
+
* @internal
|
|
1138
|
+
*/
|
|
1081
1139
|
get name(): string;
|
|
1140
|
+
/**
|
|
1141
|
+
* @internal
|
|
1142
|
+
*/
|
|
1082
1143
|
get supportedVersion(): {
|
|
1083
1144
|
min: string;
|
|
1084
1145
|
};
|
|
1146
|
+
/**
|
|
1147
|
+
* @internal
|
|
1148
|
+
*/
|
|
1085
1149
|
static get version(): string;
|
|
1150
|
+
/**
|
|
1151
|
+
* @internal
|
|
1152
|
+
*/
|
|
1086
1153
|
get events(): {
|
|
1087
1154
|
'click button': string;
|
|
1088
1155
|
};
|
|
1089
|
-
get videoElement()
|
|
1156
|
+
private get videoElement();
|
|
1157
|
+
/**
|
|
1158
|
+
* @internal
|
|
1159
|
+
*/
|
|
1090
1160
|
bindEvents(): void;
|
|
1091
1161
|
private isPiPSupported;
|
|
1162
|
+
/**
|
|
1163
|
+
* @internal
|
|
1164
|
+
*/
|
|
1092
1165
|
render(): this;
|
|
1093
|
-
togglePictureInPicture
|
|
1094
|
-
requestPictureInPicture
|
|
1095
|
-
exitPictureInPicture
|
|
1166
|
+
private togglePictureInPicture;
|
|
1167
|
+
private requestPictureInPicture;
|
|
1168
|
+
private exitPictureInPicture;
|
|
1096
1169
|
}
|
|
1097
1170
|
|
|
1098
1171
|
/**
|
|
@@ -1155,45 +1228,78 @@ export declare enum PlaybackErrorCode {
|
|
|
1155
1228
|
*/
|
|
1156
1229
|
export declare type PlaybackModule = 'dash' | 'hls' | 'html5_video';
|
|
1157
1230
|
|
|
1231
|
+
/**
|
|
1232
|
+
* Allows changing the playback speed of the video.
|
|
1233
|
+
* @beta
|
|
1234
|
+
*
|
|
1235
|
+
* @remarks
|
|
1236
|
+
* Depends on:
|
|
1237
|
+
*
|
|
1238
|
+
* - {@link MediaControl | media_control}
|
|
1239
|
+
*
|
|
1240
|
+
* - {@link BottomGear | bottom_gear}
|
|
1241
|
+
*
|
|
1242
|
+
* It renders a button in the gear menu, which opens a dropdown with the available playback rates.
|
|
1243
|
+
*/
|
|
1158
1244
|
export declare class PlaybackRate extends UICorePlugin {
|
|
1159
1245
|
private currentPlayback;
|
|
1160
1246
|
private playbackRates;
|
|
1161
1247
|
private prevSelectedRate;
|
|
1162
1248
|
private selectedRate;
|
|
1249
|
+
/**
|
|
1250
|
+
* @internal
|
|
1251
|
+
*/
|
|
1163
1252
|
get name(): string;
|
|
1253
|
+
/**
|
|
1254
|
+
* @internal
|
|
1255
|
+
*/
|
|
1164
1256
|
get supportedVersion(): {
|
|
1165
1257
|
min: string;
|
|
1166
1258
|
};
|
|
1167
|
-
|
|
1259
|
+
private static readonly template;
|
|
1260
|
+
private static readonly buttonTemplate;
|
|
1261
|
+
private static readonly listTemplate;
|
|
1262
|
+
/**
|
|
1263
|
+
* @internal
|
|
1264
|
+
*/
|
|
1168
1265
|
get attributes(): {
|
|
1169
1266
|
class: string;
|
|
1170
1267
|
'data-playback-rate-select': string;
|
|
1171
1268
|
};
|
|
1269
|
+
/**
|
|
1270
|
+
* @internal
|
|
1271
|
+
*/
|
|
1172
1272
|
get events(): {
|
|
1173
1273
|
'click .gear-sub-menu_btn': string;
|
|
1174
1274
|
'click .gear-option': string;
|
|
1175
1275
|
'click .go-back': string;
|
|
1176
1276
|
};
|
|
1277
|
+
/**
|
|
1278
|
+
* @internal
|
|
1279
|
+
*/
|
|
1177
1280
|
bindEvents(): void;
|
|
1178
|
-
unBindEvents
|
|
1281
|
+
private unBindEvents;
|
|
1179
1282
|
private allRateElements;
|
|
1180
1283
|
private rateElement;
|
|
1181
1284
|
private onDashRateChange;
|
|
1182
1285
|
private updateLiveStatus;
|
|
1183
|
-
reload
|
|
1286
|
+
private reload;
|
|
1184
1287
|
private shouldRender;
|
|
1288
|
+
/**
|
|
1289
|
+
* @internal
|
|
1290
|
+
*/
|
|
1185
1291
|
render(): this;
|
|
1186
|
-
onStartAd
|
|
1187
|
-
onFinishAd
|
|
1188
|
-
onPlay
|
|
1189
|
-
onStop
|
|
1190
|
-
onRateSelect
|
|
1191
|
-
onShowMenu
|
|
1192
|
-
goBack
|
|
1193
|
-
updatePlaybackRate
|
|
1194
|
-
setSelectedRate
|
|
1195
|
-
getTitle
|
|
1196
|
-
highlightCurrentRate
|
|
1292
|
+
private onStartAd;
|
|
1293
|
+
private onFinishAd;
|
|
1294
|
+
private onPlay;
|
|
1295
|
+
private onStop;
|
|
1296
|
+
private onRateSelect;
|
|
1297
|
+
private onShowMenu;
|
|
1298
|
+
private goBack;
|
|
1299
|
+
private updatePlaybackRate;
|
|
1300
|
+
private setSelectedRate;
|
|
1301
|
+
private getTitle;
|
|
1302
|
+
private highlightCurrentRate;
|
|
1197
1303
|
}
|
|
1198
1304
|
|
|
1199
1305
|
/**
|
|
@@ -1607,15 +1713,6 @@ export declare type PlayerPlugin = {
|
|
|
1607
1713
|
name: string;
|
|
1608
1714
|
};
|
|
1609
1715
|
|
|
1610
|
-
export declare type PluginSettings = {
|
|
1611
|
-
/**
|
|
1612
|
-
* Sends the statistics record to the storage.
|
|
1613
|
-
* The actual delivery is presumably async and batched.
|
|
1614
|
-
* @param data - The statistics record to send.
|
|
1615
|
-
*/
|
|
1616
|
-
send: (data: StatisticsRecord) => void;
|
|
1617
|
-
};
|
|
1618
|
-
|
|
1619
1716
|
/**
|
|
1620
1717
|
* Displays a poster image in the background and a big play button on top when playback is stopped
|
|
1621
1718
|
* @beta
|
|
@@ -1953,49 +2050,28 @@ export declare class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
1953
2050
|
render(): this;
|
|
1954
2051
|
}
|
|
1955
2052
|
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
private started;
|
|
1962
|
-
private timeStart;
|
|
1963
|
-
private heatmapSent;
|
|
1964
|
-
private heatmapLastTime;
|
|
1965
|
-
private watchSent;
|
|
1966
|
-
private bufTracking;
|
|
1967
|
-
private lags;
|
|
2053
|
+
/**
|
|
2054
|
+
* Playback stall event data
|
|
2055
|
+
*/
|
|
2056
|
+
export declare interface StallEventData {
|
|
2057
|
+
event: TelemetryEvent.Stall;
|
|
1968
2058
|
/**
|
|
1969
|
-
*
|
|
2059
|
+
* Accumulated buffering duration over the measurement interval, ms
|
|
1970
2060
|
*/
|
|
1971
|
-
|
|
2061
|
+
total_ms: number;
|
|
1972
2062
|
/**
|
|
1973
|
-
*
|
|
2063
|
+
* Number of stalls
|
|
1974
2064
|
*/
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
private onBuffering;
|
|
1981
|
-
private onBufferFull;
|
|
1982
|
-
private onReady;
|
|
1983
|
-
private initEvent;
|
|
1984
|
-
private sendMessage;
|
|
1985
|
-
private send;
|
|
1986
|
-
private sendHeatmap;
|
|
1987
|
-
private onTimeUpdateLive;
|
|
1988
|
-
private onStart;
|
|
2065
|
+
count: number;
|
|
2066
|
+
/**
|
|
2067
|
+
* Playback time when the stall is reported at the end of a stall measurement interval, s
|
|
2068
|
+
*/
|
|
2069
|
+
time: number;
|
|
1989
2070
|
}
|
|
1990
2071
|
|
|
1991
|
-
declare
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
declare type StatisticsRecord = {
|
|
1996
|
-
event: StatisticsEvent;
|
|
1997
|
-
type: PlaybackType;
|
|
1998
|
-
} & StatisticsEventData;
|
|
2072
|
+
export declare interface StartEventData {
|
|
2073
|
+
event: TelemetryEvent.Start;
|
|
2074
|
+
}
|
|
1999
2075
|
|
|
2000
2076
|
/**
|
|
2001
2077
|
* A {@link MediaControl | media control} plugin that provides a UI to select the subtitles when available.
|
|
@@ -2105,6 +2181,116 @@ export declare class Subtitles extends UICorePlugin {
|
|
|
2105
2181
|
private renderIcon;
|
|
2106
2182
|
}
|
|
2107
2183
|
|
|
2184
|
+
/**
|
|
2185
|
+
* Collects and reports the performance statistics.
|
|
2186
|
+
* @beta
|
|
2187
|
+
* @remarks
|
|
2188
|
+
* This plugin is experimental and its API is likely to change.
|
|
2189
|
+
*
|
|
2190
|
+
* Configuration options {@link TelemetryPluginSettings}
|
|
2191
|
+
*
|
|
2192
|
+
* @example
|
|
2193
|
+
* ```ts
|
|
2194
|
+
* import { Statistics } from '@gcorevideo/player'
|
|
2195
|
+
*
|
|
2196
|
+
* Player.registerPlugin(Statistics)
|
|
2197
|
+
*
|
|
2198
|
+
* const player = new Player({
|
|
2199
|
+
* statistics: {
|
|
2200
|
+
* send: (data) => {
|
|
2201
|
+
* fetch('/stats', {
|
|
2202
|
+
* method: 'POST',
|
|
2203
|
+
* body: JSON.stringify(data),
|
|
2204
|
+
* headers: { 'content-type': 'application/json' },
|
|
2205
|
+
* })
|
|
2206
|
+
* },
|
|
2207
|
+
* },
|
|
2208
|
+
* ...
|
|
2209
|
+
* })
|
|
2210
|
+
* ```
|
|
2211
|
+
*/
|
|
2212
|
+
export declare class Telemetry extends ContainerPlugin {
|
|
2213
|
+
/**
|
|
2214
|
+
* The name of the plugin.
|
|
2215
|
+
*/
|
|
2216
|
+
get name(): string;
|
|
2217
|
+
/**
|
|
2218
|
+
* The supported version of the plugin.
|
|
2219
|
+
*/
|
|
2220
|
+
get supportedVersion(): {
|
|
2221
|
+
min: string;
|
|
2222
|
+
};
|
|
2223
|
+
private started;
|
|
2224
|
+
private timeStart;
|
|
2225
|
+
private stallSent;
|
|
2226
|
+
private stallLastTime;
|
|
2227
|
+
private watchSent;
|
|
2228
|
+
private bufTracking;
|
|
2229
|
+
private numStalls;
|
|
2230
|
+
/**
|
|
2231
|
+
* The time when buffering last started.
|
|
2232
|
+
*/
|
|
2233
|
+
private bufLastStarted;
|
|
2234
|
+
/**
|
|
2235
|
+
* The accumulated buffering duration.
|
|
2236
|
+
*/
|
|
2237
|
+
private stallAcc;
|
|
2238
|
+
constructor(container: Container);
|
|
2239
|
+
/**
|
|
2240
|
+
* @internal
|
|
2241
|
+
*/
|
|
2242
|
+
bindEvents(): void;
|
|
2243
|
+
private startLevelSwitch;
|
|
2244
|
+
private endLevelSwitch;
|
|
2245
|
+
private onBuffering;
|
|
2246
|
+
private onBufferFull;
|
|
2247
|
+
private onReady;
|
|
2248
|
+
private sendInit;
|
|
2249
|
+
private send;
|
|
2250
|
+
private sendStall;
|
|
2251
|
+
private onTimeUpdate;
|
|
2252
|
+
private onStart;
|
|
2253
|
+
}
|
|
2254
|
+
|
|
2255
|
+
/**
|
|
2256
|
+
* Telemetry event type
|
|
2257
|
+
*/
|
|
2258
|
+
export declare enum TelemetryEvent {
|
|
2259
|
+
Init = 1,
|
|
2260
|
+
Start = 2,
|
|
2261
|
+
Watch = 3,
|
|
2262
|
+
Stall = 4
|
|
2263
|
+
}
|
|
2264
|
+
|
|
2265
|
+
/**
|
|
2266
|
+
* Telemetry event data
|
|
2267
|
+
*/
|
|
2268
|
+
export declare type TelemetryEventData = StallEventData | InitEventData | StartEventData | WatchEventData;
|
|
2269
|
+
|
|
2270
|
+
/**
|
|
2271
|
+
* Plugin settings
|
|
2272
|
+
*/
|
|
2273
|
+
export declare interface TelemetryPluginSettings {
|
|
2274
|
+
/**
|
|
2275
|
+
* Sends the statistics record to the storage.
|
|
2276
|
+
* The actual delivery is presumably async and batched.
|
|
2277
|
+
*/
|
|
2278
|
+
send: TelemetrySendFn;
|
|
2279
|
+
}
|
|
2280
|
+
|
|
2281
|
+
/**
|
|
2282
|
+
* Telemetry record
|
|
2283
|
+
*/
|
|
2284
|
+
export declare type TelemetryRecord = {
|
|
2285
|
+
type: PlaybackType;
|
|
2286
|
+
} & TelemetryEventData;
|
|
2287
|
+
|
|
2288
|
+
/**
|
|
2289
|
+
* Callback to send the telemetry record to the storage.
|
|
2290
|
+
* @param data - The telemetry record to send.
|
|
2291
|
+
*/
|
|
2292
|
+
declare type TelemetrySendFn = (data: TelemetryRecord) => void;
|
|
2293
|
+
|
|
2108
2294
|
export declare class Thumbnails extends UICorePlugin {
|
|
2109
2295
|
private _$spotlight;
|
|
2110
2296
|
private _$backdrop;
|
|
@@ -2252,9 +2438,15 @@ export declare class VolumeFade extends UICorePlugin {
|
|
|
2252
2438
|
private container;
|
|
2253
2439
|
private delay;
|
|
2254
2440
|
private interval;
|
|
2441
|
+
/**
|
|
2442
|
+
* @internal
|
|
2443
|
+
*/
|
|
2255
2444
|
get name(): string;
|
|
2445
|
+
/**
|
|
2446
|
+
* @internal
|
|
2447
|
+
*/
|
|
2256
2448
|
bindEvents(): void;
|
|
2257
|
-
unBindEvents
|
|
2449
|
+
private unBindEvents;
|
|
2258
2450
|
private _onUserChangeVolume;
|
|
2259
2451
|
private _onVolumeConfig;
|
|
2260
2452
|
private onCoreReady;
|
|
@@ -2268,6 +2460,10 @@ export declare enum VolumeFadeEvents {
|
|
|
2268
2460
|
FADE = "core:volume:fade"
|
|
2269
2461
|
}
|
|
2270
2462
|
|
|
2463
|
+
export declare interface WatchEventData {
|
|
2464
|
+
event: TelemetryEvent.Watch;
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2271
2467
|
/**
|
|
2272
2468
|
* @beta
|
|
2273
2469
|
*/
|