@ceeblue/web-utils 7.1.0 → 7.3.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/dist/web-utils.d.ts +58 -9
- package/dist/web-utils.js +11116 -8
- package/dist/web-utils.js.map +1 -1
- package/dist/web-utils.min.js +1 -1
- package/dist/web-utils.min.js.map +1 -1
- package/package.json +22 -13
- package/typedoc.json +5 -0
package/dist/web-utils.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import * as CML from '@svta/common-media-library';
|
|
2
|
+
export { CML };
|
|
3
|
+
|
|
1
4
|
declare class BinaryReader {
|
|
2
5
|
private _data;
|
|
3
6
|
private _size;
|
|
@@ -136,7 +139,7 @@ interface ILog {
|
|
|
136
139
|
/**
|
|
137
140
|
* Intercept,redefine or redirect any log
|
|
138
141
|
* If you clear args you intercept the log and nothing happen more after this call.
|
|
139
|
-
* @param
|
|
142
|
+
* @param level log level
|
|
140
143
|
* @param args args
|
|
141
144
|
* @returns
|
|
142
145
|
*/
|
|
@@ -144,7 +147,7 @@ interface ILog {
|
|
|
144
147
|
/**
|
|
145
148
|
* Change log level, default log level is {@link LogLevel.INFO},
|
|
146
149
|
* Boolean can be user to lets pass all the logs with `true` or disables all the logs with `false`.
|
|
147
|
-
* @
|
|
150
|
+
* @remarks To debug production code without modifying it you can use a special query parameter
|
|
148
151
|
* called !cb-override-log-level to override this configuration.
|
|
149
152
|
*/
|
|
150
153
|
level?: LogLevel | boolean;
|
|
@@ -817,10 +820,12 @@ declare const SDP: {
|
|
|
817
820
|
*/
|
|
818
821
|
declare const EMPTY_FUNCTION: () => void;
|
|
819
822
|
/**
|
|
820
|
-
* Returns an efficient timestamp in milliseconds elapsed since
|
|
823
|
+
* Returns an efficient timestamp in milliseconds elapsed since performance.timeOrigin,
|
|
821
824
|
* representing the start of the current JavaScript execution context.
|
|
822
825
|
*
|
|
823
|
-
*
|
|
826
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Performance/timeOrigin
|
|
827
|
+
*
|
|
828
|
+
* @remarks Each Web Worker runs in a separate JS context, so timestamps
|
|
824
829
|
* are not directly comparable between different workers. Use {@link unixTime}
|
|
825
830
|
* for comparable timestamps across different Web Workers.
|
|
826
831
|
*/
|
|
@@ -956,11 +961,10 @@ declare function trimEnd(value: string, chars?: string): string;
|
|
|
956
961
|
* Property lookup (e.g. `obj.Foo` or `obj.foo`) will resolve to the same underlying key, regardless of casing.
|
|
957
962
|
* Only affects string-based property access (not symbols).
|
|
958
963
|
*
|
|
959
|
-
* @
|
|
960
|
-
* @
|
|
961
|
-
* @returns {T} A proxied object with case-insensitive property access.
|
|
964
|
+
* @param obj - The original object.
|
|
965
|
+
* @returns A proxied object with case-insensitive property access.
|
|
962
966
|
*/
|
|
963
|
-
declare function caseInsensitive
|
|
967
|
+
declare function caseInsensitive(obj: any): Record<string, any>;
|
|
964
968
|
|
|
965
969
|
declare const Util_EMPTY_FUNCTION: typeof EMPTY_FUNCTION;
|
|
966
970
|
declare const Util_caseInsensitive: typeof caseInsensitive;
|
|
@@ -1182,6 +1186,51 @@ declare namespace EpochTime {
|
|
|
1182
1186
|
export { EpochTime_decodeTimestamp as decodeTimestamp, EpochTime_encodeTimestamp as encodeTimestamp, EpochTime_getLatency as getLatency };
|
|
1183
1187
|
}
|
|
1184
1188
|
|
|
1189
|
+
/**
|
|
1190
|
+
* Copyright 2024 Ceeblue B.V.
|
|
1191
|
+
* This file is part of https://github.com/CeeblueTV/web-utils which is released under GNU Affero General Public License.
|
|
1192
|
+
* See file LICENSE or go to https://spdx.org/licenses/AGPL-3.0-or-later.html for full license details.
|
|
1193
|
+
*/
|
|
1194
|
+
|
|
1195
|
+
/**
|
|
1196
|
+
* Collects variable names for player statistics metrics across different projects (e.g., wrts, webrtc).
|
|
1197
|
+
* Variables remain undefined if they are not present in the stats for the current project
|
|
1198
|
+
* (for example, 'latency' is undefined for webrtc).
|
|
1199
|
+
* Includes the toCmcd() method to convert stats into a CMCD payload.
|
|
1200
|
+
*/
|
|
1201
|
+
declare class PlayerStats {
|
|
1202
|
+
protocol?: string;
|
|
1203
|
+
currentTime?: number;
|
|
1204
|
+
waitingData?: boolean;
|
|
1205
|
+
bufferAmount?: number;
|
|
1206
|
+
latency?: number;
|
|
1207
|
+
rtt?: number;
|
|
1208
|
+
jitter?: number;
|
|
1209
|
+
playbackSpeed?: number;
|
|
1210
|
+
playbackRate?: number;
|
|
1211
|
+
recvByteRate?: number;
|
|
1212
|
+
sendByteRate?: number;
|
|
1213
|
+
videoTrackId?: number;
|
|
1214
|
+
videoTrackBandwidth?: number;
|
|
1215
|
+
audioTrackId?: number;
|
|
1216
|
+
audioTrackBandwidth?: number;
|
|
1217
|
+
videoPerSecond?: number;
|
|
1218
|
+
audioPerSecond?: number;
|
|
1219
|
+
skippedVideoCount?: number;
|
|
1220
|
+
skippedAudioCount?: number;
|
|
1221
|
+
lostPacketCount?: number;
|
|
1222
|
+
nackCount?: number;
|
|
1223
|
+
stallCount?: number;
|
|
1224
|
+
/**
|
|
1225
|
+
* Converts the current {@link PlayerStats} snapshot into a CMCD (Common Media Client Data) payload.
|
|
1226
|
+
* @param url - The full URL of the media object.
|
|
1227
|
+
* @param trackId - The track ID for which to generate the CMCD payload.
|
|
1228
|
+
* @param prevStats - Optional previous {@link PlayerStats} snapshot to calculate deltas for incremental metrics since their last reset.
|
|
1229
|
+
* @returns A {@link CML.Cmcd} object representing the CMCD payload.
|
|
1230
|
+
*/
|
|
1231
|
+
toCmcd(url: URL, trackId: number, prevStats?: PlayerStats): CML.Cmcd;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1185
1234
|
/**
|
|
1186
1235
|
* Copyright 2024 Ceeblue B.V.
|
|
1187
1236
|
* This file is part of https://github.com/CeeblueTV/web-utils which is released under GNU Affero General Public License.
|
|
@@ -1279,4 +1328,4 @@ declare class UIMetrics {
|
|
|
1279
1328
|
|
|
1280
1329
|
declare const VERSION: string;
|
|
1281
1330
|
|
|
1282
|
-
export { BinaryReader, BinaryWriter, BitReader, ByteRate, Connect, EpochTime, EventEmitter, FixMap, type ILog, Log, LogLevel, Loggable, NetAddress, Numbers, Queue, SDP, UIMetrics, Util, VERSION, WebSocketReliable, type WebSocketReliableError, log };
|
|
1331
|
+
export { BinaryReader, BinaryWriter, BitReader, ByteRate, Connect, EpochTime, EventEmitter, FixMap, type ILog, Log, LogLevel, Loggable, NetAddress, Numbers, PlayerStats, Queue, SDP, UIMetrics, Util, VERSION, WebSocketReliable, type WebSocketReliableError, log };
|