@vindral/web-sdk 2.0.17 → 2.0.20
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/LICENSES +36 -15
- package/index.d.ts +68 -10
- package/package.json +1 -1
- package/web-sdk.esm.js +1 -1
- package/web-sdk.umd.js +1 -1
package/LICENSES
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
libopus license
|
|
2
|
-
---------------
|
|
1
|
+
## libopus license
|
|
3
2
|
|
|
4
3
|
Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
Jean-Marc Valin, Timothy B. Terriberry,
|
|
5
|
+
CSIRO, Gregory Maxwell, Mark Borgerding,
|
|
6
|
+
Erik de Castro Lopo
|
|
8
7
|
|
|
9
8
|
Redistribution and use in source and binary forms, with or without
|
|
10
9
|
modification, are permitted provided that the following conditions
|
|
11
10
|
are met:
|
|
12
11
|
|
|
13
12
|
- Redistributions of source code must retain the above copyright
|
|
14
|
-
notice, this list of conditions and the following disclaimer.
|
|
13
|
+
notice, this list of conditions and the following disclaimer.
|
|
15
14
|
|
|
16
15
|
- Redistributions in binary form must reproduce the above copyright
|
|
17
|
-
notice, this list of conditions and the following disclaimer in the
|
|
18
|
-
documentation and/or other materials provided with the distribution.
|
|
16
|
+
notice, this list of conditions and the following disclaimer in the
|
|
17
|
+
documentation and/or other materials provided with the distribution.
|
|
19
18
|
|
|
20
19
|
- Neither the name of Internet Society, IETF or IETF Trust, nor the
|
|
21
|
-
names of specific contributors, may be used to endorse or promote
|
|
22
|
-
products derived from this software without specific prior written
|
|
23
|
-
permission.
|
|
20
|
+
names of specific contributors, may be used to endorse or promote
|
|
21
|
+
products derived from this software without specific prior written
|
|
22
|
+
permission.
|
|
24
23
|
|
|
25
24
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
26
25
|
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
@@ -46,10 +45,7 @@ https://datatracker.ietf.org/ipr/1914/
|
|
|
46
45
|
Broadcom Corporation:
|
|
47
46
|
https://datatracker.ietf.org/ipr/1526/
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
h264 license
|
|
52
|
-
------------
|
|
48
|
+
## h264 license
|
|
53
49
|
|
|
54
50
|
Copyright (C) 2009 The Android Open Source Project
|
|
55
51
|
|
|
@@ -64,3 +60,28 @@ distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
64
60
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
65
61
|
See the License for the specific language governing permissions and
|
|
66
62
|
limitations under the License.
|
|
63
|
+
|
|
64
|
+
## nosleep license
|
|
65
|
+
|
|
66
|
+
The MIT License (MIT)
|
|
67
|
+
|
|
68
|
+
Copyright (c) Rich Tibbett
|
|
69
|
+
|
|
70
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
71
|
+
a copy of this software and associated documentation files (the
|
|
72
|
+
"Software"), to deal in the Software without restriction, including
|
|
73
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
74
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
75
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
76
|
+
the following conditions:
|
|
77
|
+
|
|
78
|
+
The above copyright notice and this permission notice shall be
|
|
79
|
+
included in all copies or substantial portions of the Software.
|
|
80
|
+
|
|
81
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
82
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
83
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
84
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
85
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
86
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
87
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ interface DecodedSampleStatistics {
|
|
|
27
27
|
decodeTime: number;
|
|
28
28
|
transportTimeFromWorker: number;
|
|
29
29
|
transportTimeToWorker: number;
|
|
30
|
+
samplesInBatch: number;
|
|
30
31
|
}
|
|
31
32
|
interface DecodedVideoSample {
|
|
32
33
|
type: "video";
|
|
@@ -191,6 +192,7 @@ interface MediaElementOptions {
|
|
|
191
192
|
muted: boolean;
|
|
192
193
|
type: "audio" | "video";
|
|
193
194
|
logger: Logger;
|
|
195
|
+
poster?: string;
|
|
194
196
|
}
|
|
195
197
|
interface NeedsUserInputContext {
|
|
196
198
|
forAudio: boolean;
|
|
@@ -208,7 +210,7 @@ declare class MediaElement extends Emitter<MediaElementEvents> {
|
|
|
208
210
|
private _userProvidedMuted;
|
|
209
211
|
private _userHasProvidedInput;
|
|
210
212
|
isActivated: boolean;
|
|
211
|
-
constructor({ type, autoplay, muted, logger }: MediaElementOptions);
|
|
213
|
+
constructor({ type, autoplay, muted, logger, poster }: MediaElementOptions);
|
|
212
214
|
attach: (container: HTMLElement) => void;
|
|
213
215
|
get seekTime(): number;
|
|
214
216
|
get isSeeking(): boolean;
|
|
@@ -286,11 +288,9 @@ interface QualityOfServiceConfig {
|
|
|
286
288
|
cooldownTime: number;
|
|
287
289
|
maxBufferingEvents: {
|
|
288
290
|
last10Seconds: number;
|
|
289
|
-
last30Seconds: number;
|
|
290
291
|
};
|
|
291
292
|
maxBufferingRatio: {
|
|
292
293
|
last10Seconds: number;
|
|
293
|
-
last30Seconds: number;
|
|
294
294
|
};
|
|
295
295
|
maxRecentDowngradesCount: number;
|
|
296
296
|
maxDowngradeLookbackMs: number;
|
|
@@ -389,6 +389,51 @@ declare class AudioPlayerModule {
|
|
|
389
389
|
private getAudioContext;
|
|
390
390
|
private setGain;
|
|
391
391
|
}
|
|
392
|
+
interface BufferTimeConfig {
|
|
393
|
+
minBufferTime: number;
|
|
394
|
+
maxBufferTime: number;
|
|
395
|
+
cooldownTime: number;
|
|
396
|
+
maxBufferingEvents: {
|
|
397
|
+
last30Seconds: number;
|
|
398
|
+
};
|
|
399
|
+
maxBufferingRatio: {
|
|
400
|
+
last30Seconds: number;
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
interface BufferTimeListeners {
|
|
404
|
+
["buffer state"]: Readonly<BufferState>;
|
|
405
|
+
}
|
|
406
|
+
interface BufferTimeStatistics {
|
|
407
|
+
bufferTimeAdjustmentCount: number;
|
|
408
|
+
}
|
|
409
|
+
interface TargetBufferTimeTarget {
|
|
410
|
+
targetBufferTime: number;
|
|
411
|
+
}
|
|
412
|
+
interface QualityOfServiceSource {
|
|
413
|
+
bufferingEventsLast(last: number): number;
|
|
414
|
+
timeSpentBufferingLast(last: number): number;
|
|
415
|
+
timeSpentActiveLast(last: number): number;
|
|
416
|
+
}
|
|
417
|
+
declare class BufferTimeModule {
|
|
418
|
+
private static BUFFER_TIME_STEP_SIZE;
|
|
419
|
+
private qualityOfServiceSource;
|
|
420
|
+
private targetBufferTimeTarget;
|
|
421
|
+
private config;
|
|
422
|
+
private emitter;
|
|
423
|
+
private logger;
|
|
424
|
+
private isSuspended;
|
|
425
|
+
private lastIncreaseTime;
|
|
426
|
+
private bufferTimeAdjustmentCount;
|
|
427
|
+
constructor(emitter: Emitter<BufferTimeListeners, unknown>, logger: Logger, qualityOfServiceSource: QualityOfServiceSource, targetBufferTimeTarget: TargetBufferTimeTarget, config: Partial<BufferTimeConfig>);
|
|
428
|
+
static create: (emitter: Emitter<BufferTimeListeners, unknown>, logger: Logger, qualityOfServiceSource: QualityOfServiceSource, targetBufferTimeTarget: TargetBufferTimeTarget, config?: Partial<BufferTimeConfig>) => BufferTimeModule;
|
|
429
|
+
load: () => void;
|
|
430
|
+
unload: () => void;
|
|
431
|
+
suspend: () => void;
|
|
432
|
+
unsuspend: () => void;
|
|
433
|
+
reset: () => void;
|
|
434
|
+
getStatistics: () => BufferTimeStatistics;
|
|
435
|
+
private onBufferState;
|
|
436
|
+
}
|
|
392
437
|
interface VindralErrorProps {
|
|
393
438
|
isFatal: boolean;
|
|
394
439
|
code: string;
|
|
@@ -459,9 +504,9 @@ declare class ConnectionModule {
|
|
|
459
504
|
private transport?;
|
|
460
505
|
private logger;
|
|
461
506
|
private options;
|
|
462
|
-
private pingInterval?;
|
|
463
507
|
private rtts;
|
|
464
|
-
private lastPingSentTime
|
|
508
|
+
private lastPingSentTime;
|
|
509
|
+
private isPingInFlight;
|
|
465
510
|
private connectCount;
|
|
466
511
|
private _firstConnectionTime?;
|
|
467
512
|
private _lastConnectionTime?;
|
|
@@ -488,7 +533,8 @@ declare class ConnectionModule {
|
|
|
488
533
|
private onTransportChange;
|
|
489
534
|
disconnect: (reason?: string) => void;
|
|
490
535
|
reconnect: (reason: string) => void;
|
|
491
|
-
private
|
|
536
|
+
private resetPingState;
|
|
537
|
+
private pingCooldownExpired;
|
|
492
538
|
private sendPing;
|
|
493
539
|
}
|
|
494
540
|
interface Size {
|
|
@@ -813,8 +859,11 @@ interface MseModuleListeners {
|
|
|
813
859
|
}
|
|
814
860
|
interface MseModuleStatistics {
|
|
815
861
|
quotaErrorCount: number;
|
|
862
|
+
totalVideoFrames?: number;
|
|
863
|
+
droppedVideoFrames?: number;
|
|
816
864
|
}
|
|
817
865
|
declare class MseModule {
|
|
866
|
+
private readonly maxChunkSize;
|
|
818
867
|
private logger;
|
|
819
868
|
private timers;
|
|
820
869
|
private emitter;
|
|
@@ -823,8 +872,6 @@ declare class MseModule {
|
|
|
823
872
|
private mediaSource;
|
|
824
873
|
private trackContexts;
|
|
825
874
|
private autoRecoverFromMediaErrors;
|
|
826
|
-
private pendingSamples;
|
|
827
|
-
private isWorkingOnPendingSamples;
|
|
828
875
|
private quotaErrorCount;
|
|
829
876
|
constructor(logger: Logger, emitter: Emitter<MseModuleListeners, MseModuleEvents>, mediaElement: HTMLMediaElement, tracks: Track[]);
|
|
830
877
|
static create: (logger: Logger, emitter: Emitter<MseModuleListeners, MseModuleEvents>, mediaElement: HTMLMediaElement, tracks: Track[]) => Promise<MseModule>;
|
|
@@ -833,9 +880,8 @@ declare class MseModule {
|
|
|
833
880
|
private open;
|
|
834
881
|
getBuffer: (type: Type) => TimeRange[];
|
|
835
882
|
init: (initSegment: Readonly<InitSegment>) => void;
|
|
836
|
-
append: (
|
|
883
|
+
append: (samples: Readonly<CodedSample>[], needsInitSegment: boolean) => Promise<void>;
|
|
837
884
|
private onCodedSample;
|
|
838
|
-
private work;
|
|
839
885
|
private onSourceEnded;
|
|
840
886
|
}
|
|
841
887
|
interface PictureInPictureListeners {
|
|
@@ -906,6 +952,7 @@ declare class QualityOfServiceModule {
|
|
|
906
952
|
getBufferFullnessRegression: () => Regression | undefined;
|
|
907
953
|
activeRatios: () => Map<string, number>;
|
|
908
954
|
bufferingRatios: () => Map<string, number>;
|
|
955
|
+
bufferingEventsLast: (last: number) => number;
|
|
909
956
|
timeSpentBufferingLast: (last: number) => number;
|
|
910
957
|
timeSpentActiveLast: (last: number) => number;
|
|
911
958
|
timeSpentPlayingInAtLeastLevelRatio: (renditionLevel: RenditionLevel) => number;
|
|
@@ -955,6 +1002,7 @@ declare class SubscriptionModule {
|
|
|
955
1002
|
setVideoCodec: (videoCodec: VideoCodec | undefined) => void;
|
|
956
1003
|
setAudioCodec: (audioCodec: AudioCodec | undefined) => void;
|
|
957
1004
|
private setBurst;
|
|
1005
|
+
private isNewSubscription;
|
|
958
1006
|
private onSubscriptionChanged;
|
|
959
1007
|
private scheduleSubscriptionChange;
|
|
960
1008
|
}
|
|
@@ -1069,7 +1117,9 @@ declare const defaultOptions: {
|
|
|
1069
1117
|
maxAudioBitRate: number;
|
|
1070
1118
|
tags: string[];
|
|
1071
1119
|
media: Media;
|
|
1120
|
+
poster: string | boolean;
|
|
1072
1121
|
reconnectHandler: (state: ReconnectState) => Promise<boolean> | boolean;
|
|
1122
|
+
iosWakeLockEnabled: boolean;
|
|
1073
1123
|
advanced: {
|
|
1074
1124
|
wasmDecodingConstraint: Partial<VideoConstraint>;
|
|
1075
1125
|
};
|
|
@@ -1123,6 +1173,7 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
|
|
|
1123
1173
|
private hasCalledConnect;
|
|
1124
1174
|
private apiClient;
|
|
1125
1175
|
private latestEmittedLanguages;
|
|
1176
|
+
private wakeLock;
|
|
1126
1177
|
private durationSessions;
|
|
1127
1178
|
constructor(options: Options);
|
|
1128
1179
|
attach: (container: HTMLElement) => void;
|
|
@@ -1171,7 +1222,9 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
|
|
|
1171
1222
|
get bufferingRatios(): Map<string, number>;
|
|
1172
1223
|
get timeSpentBuffering(): number;
|
|
1173
1224
|
get timeActive(): number;
|
|
1225
|
+
get mediaElement(): HTMLMediaElement | HTMLCanvasElement;
|
|
1174
1226
|
getOptions: () => Options & typeof defaultOptions;
|
|
1227
|
+
getThumbnailUrl: () => string;
|
|
1175
1228
|
updateAuthenticationToken: (token: string) => void;
|
|
1176
1229
|
connect: () => void;
|
|
1177
1230
|
getCastOptions: () => Options;
|
|
@@ -1272,6 +1325,7 @@ interface ClockSource {
|
|
|
1272
1325
|
}
|
|
1273
1326
|
interface VideoPlayerStatistics {
|
|
1274
1327
|
renderedFrameCount: number;
|
|
1328
|
+
rendererDroppedFrameCount: number;
|
|
1275
1329
|
}
|
|
1276
1330
|
declare class VideoPlayerModule {
|
|
1277
1331
|
private logger;
|
|
@@ -1282,6 +1336,7 @@ declare class VideoPlayerModule {
|
|
|
1282
1336
|
private isFirstFrame;
|
|
1283
1337
|
private animationFrameRequest?;
|
|
1284
1338
|
private renderedFrameCount;
|
|
1339
|
+
private rendererDroppedFrameCount;
|
|
1285
1340
|
constructor(emitter: Emitter<VideoPlayerModuleListeners, unknown>, logger: Logger, clockSource: ClockSource);
|
|
1286
1341
|
unload: () => Promise<void>;
|
|
1287
1342
|
suspend: () => void;
|
|
@@ -1313,6 +1368,7 @@ export interface Modules {
|
|
|
1313
1368
|
telemetry?: TelemetryModule;
|
|
1314
1369
|
documentState: DocumentStateModule;
|
|
1315
1370
|
incomingData: IncomingDataModule;
|
|
1371
|
+
bufferTime: BufferTimeModule;
|
|
1316
1372
|
unpause?: UnpauseModule;
|
|
1317
1373
|
}
|
|
1318
1374
|
export interface ReconnectState {
|
|
@@ -1341,6 +1397,7 @@ export interface Options {
|
|
|
1341
1397
|
maxSize?: Size;
|
|
1342
1398
|
maxAudioBitRate?: number;
|
|
1343
1399
|
maxVideoBitRate?: number;
|
|
1400
|
+
poster?: boolean | string;
|
|
1344
1401
|
muted?: boolean;
|
|
1345
1402
|
reconnectHandler?: (state: ReconnectState) => Promise<boolean> | boolean;
|
|
1346
1403
|
tags?: string[];
|
|
@@ -1348,6 +1405,7 @@ export interface Options {
|
|
|
1348
1405
|
edgeUrl?: string;
|
|
1349
1406
|
logShippingEnabled?: boolean;
|
|
1350
1407
|
statsShippingEnabled?: boolean;
|
|
1408
|
+
iosWakeLockEnabled?: boolean;
|
|
1351
1409
|
advanced?: AdvancedOptions;
|
|
1352
1410
|
media?: Media;
|
|
1353
1411
|
}
|
package/package.json
CHANGED