@vindral/web-sdk 2.0.18 → 2.0.21

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 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
- Jean-Marc Valin, Timothy B. Terriberry,
6
- CSIRO, Gregory Maxwell, Mark Borgerding,
7
- Erik de Castro Lopo
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";
@@ -287,11 +288,9 @@ interface QualityOfServiceConfig {
287
288
  cooldownTime: number;
288
289
  maxBufferingEvents: {
289
290
  last10Seconds: number;
290
- last30Seconds: number;
291
291
  };
292
292
  maxBufferingRatio: {
293
293
  last10Seconds: number;
294
- last30Seconds: number;
295
294
  };
296
295
  maxRecentDowngradesCount: number;
297
296
  maxDowngradeLookbackMs: number;
@@ -390,6 +389,51 @@ declare class AudioPlayerModule {
390
389
  private getAudioContext;
391
390
  private setGain;
392
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
+ }
393
437
  interface VindralErrorProps {
394
438
  isFatal: boolean;
395
439
  code: string;
@@ -460,9 +504,9 @@ declare class ConnectionModule {
460
504
  private transport?;
461
505
  private logger;
462
506
  private options;
463
- private pingInterval?;
464
507
  private rtts;
465
- private lastPingSentTime?;
508
+ private lastPingSentTime;
509
+ private isPingInFlight;
466
510
  private connectCount;
467
511
  private _firstConnectionTime?;
468
512
  private _lastConnectionTime?;
@@ -489,7 +533,8 @@ declare class ConnectionModule {
489
533
  private onTransportChange;
490
534
  disconnect: (reason?: string) => void;
491
535
  reconnect: (reason: string) => void;
492
- private cleanupPingIntervals;
536
+ private resetPingState;
537
+ private pingCooldownExpired;
493
538
  private sendPing;
494
539
  }
495
540
  interface Size {
@@ -814,8 +859,11 @@ interface MseModuleListeners {
814
859
  }
815
860
  interface MseModuleStatistics {
816
861
  quotaErrorCount: number;
862
+ totalVideoFrames?: number;
863
+ droppedVideoFrames?: number;
817
864
  }
818
865
  declare class MseModule {
866
+ private readonly maxChunkSize;
819
867
  private logger;
820
868
  private timers;
821
869
  private emitter;
@@ -824,8 +872,6 @@ declare class MseModule {
824
872
  private mediaSource;
825
873
  private trackContexts;
826
874
  private autoRecoverFromMediaErrors;
827
- private pendingSamples;
828
- private isWorkingOnPendingSamples;
829
875
  private quotaErrorCount;
830
876
  constructor(logger: Logger, emitter: Emitter<MseModuleListeners, MseModuleEvents>, mediaElement: HTMLMediaElement, tracks: Track[]);
831
877
  static create: (logger: Logger, emitter: Emitter<MseModuleListeners, MseModuleEvents>, mediaElement: HTMLMediaElement, tracks: Track[]) => Promise<MseModule>;
@@ -834,9 +880,8 @@ declare class MseModule {
834
880
  private open;
835
881
  getBuffer: (type: Type) => TimeRange[];
836
882
  init: (initSegment: Readonly<InitSegment>) => void;
837
- append: (sample: Readonly<CodedSample>) => Promise<void>;
883
+ append: (samples: Readonly<CodedSample>[], needsInitSegment: boolean) => Promise<void>;
838
884
  private onCodedSample;
839
- private work;
840
885
  private onSourceEnded;
841
886
  }
842
887
  interface PictureInPictureListeners {
@@ -907,6 +952,7 @@ declare class QualityOfServiceModule {
907
952
  getBufferFullnessRegression: () => Regression | undefined;
908
953
  activeRatios: () => Map<string, number>;
909
954
  bufferingRatios: () => Map<string, number>;
955
+ bufferingEventsLast: (last: number) => number;
910
956
  timeSpentBufferingLast: (last: number) => number;
911
957
  timeSpentActiveLast: (last: number) => number;
912
958
  timeSpentPlayingInAtLeastLevelRatio: (renditionLevel: RenditionLevel) => number;
@@ -956,6 +1002,7 @@ declare class SubscriptionModule {
956
1002
  setVideoCodec: (videoCodec: VideoCodec | undefined) => void;
957
1003
  setAudioCodec: (audioCodec: AudioCodec | undefined) => void;
958
1004
  private setBurst;
1005
+ private isNewSubscription;
959
1006
  private onSubscriptionChanged;
960
1007
  private scheduleSubscriptionChange;
961
1008
  }
@@ -1070,8 +1117,9 @@ declare const defaultOptions: {
1070
1117
  maxAudioBitRate: number;
1071
1118
  tags: string[];
1072
1119
  media: Media;
1073
- posterEnabled: boolean;
1120
+ poster: string | boolean;
1074
1121
  reconnectHandler: (state: ReconnectState) => Promise<boolean> | boolean;
1122
+ iosWakeLockEnabled: boolean;
1075
1123
  advanced: {
1076
1124
  wasmDecodingConstraint: Partial<VideoConstraint>;
1077
1125
  };
@@ -1125,6 +1173,7 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
1125
1173
  private hasCalledConnect;
1126
1174
  private apiClient;
1127
1175
  private latestEmittedLanguages;
1176
+ private wakeLock;
1128
1177
  private durationSessions;
1129
1178
  constructor(options: Options);
1130
1179
  attach: (container: HTMLElement) => void;
@@ -1173,6 +1222,7 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
1173
1222
  get bufferingRatios(): Map<string, number>;
1174
1223
  get timeSpentBuffering(): number;
1175
1224
  get timeActive(): number;
1225
+ get mediaElement(): HTMLMediaElement | HTMLCanvasElement;
1176
1226
  getOptions: () => Options & typeof defaultOptions;
1177
1227
  getThumbnailUrl: () => string;
1178
1228
  updateAuthenticationToken: (token: string) => void;
@@ -1275,6 +1325,7 @@ interface ClockSource {
1275
1325
  }
1276
1326
  interface VideoPlayerStatistics {
1277
1327
  renderedFrameCount: number;
1328
+ rendererDroppedFrameCount: number;
1278
1329
  }
1279
1330
  declare class VideoPlayerModule {
1280
1331
  private logger;
@@ -1285,6 +1336,7 @@ declare class VideoPlayerModule {
1285
1336
  private isFirstFrame;
1286
1337
  private animationFrameRequest?;
1287
1338
  private renderedFrameCount;
1339
+ private rendererDroppedFrameCount;
1288
1340
  constructor(emitter: Emitter<VideoPlayerModuleListeners, unknown>, logger: Logger, clockSource: ClockSource);
1289
1341
  unload: () => Promise<void>;
1290
1342
  suspend: () => void;
@@ -1316,6 +1368,7 @@ export interface Modules {
1316
1368
  telemetry?: TelemetryModule;
1317
1369
  documentState: DocumentStateModule;
1318
1370
  incomingData: IncomingDataModule;
1371
+ bufferTime: BufferTimeModule;
1319
1372
  unpause?: UnpauseModule;
1320
1373
  }
1321
1374
  export interface ReconnectState {
@@ -1344,7 +1397,7 @@ export interface Options {
1344
1397
  maxSize?: Size;
1345
1398
  maxAudioBitRate?: number;
1346
1399
  maxVideoBitRate?: number;
1347
- posterEnabled?: boolean;
1400
+ poster?: boolean | string;
1348
1401
  muted?: boolean;
1349
1402
  reconnectHandler?: (state: ReconnectState) => Promise<boolean> | boolean;
1350
1403
  tags?: string[];
@@ -1352,6 +1405,7 @@ export interface Options {
1352
1405
  edgeUrl?: string;
1353
1406
  logShippingEnabled?: boolean;
1354
1407
  statsShippingEnabled?: boolean;
1408
+ iosWakeLockEnabled?: boolean;
1355
1409
  advanced?: AdvancedOptions;
1356
1410
  media?: Media;
1357
1411
  }
@@ -1511,6 +1565,7 @@ export interface ConnectResponse {
1511
1565
  export interface ApiClientOptions {
1512
1566
  publicEndpoint: string;
1513
1567
  tokenFactory?: AuthorizationTokenFactory;
1568
+ sessionId?: string;
1514
1569
  }
1515
1570
  export interface AuthorizationContext {
1516
1571
  channelGroupId?: string;
@@ -1520,10 +1575,12 @@ export declare type AuthorizationTokenFactory = (context: AuthorizationContext)
1520
1575
  export declare class ApiClient {
1521
1576
  private baseUrl;
1522
1577
  private tokenFactory?;
1578
+ private sessionId?;
1523
1579
  constructor(options: ApiClientOptions);
1524
1580
  connect(options: ConnectOptions): Promise<ConnectResponse>;
1525
1581
  getChannel(channelId: string): Promise<Channel>;
1526
1582
  getChannels(channelGroupId: string): Promise<Channel[]>;
1583
+ private getHeaders;
1527
1584
  private getAuthToken;
1528
1585
  private toChannels;
1529
1586
  private toChannel;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vindral/web-sdk",
3
- "version": "2.0.18",
3
+ "version": "2.0.21",
4
4
  "homepage": "https://vindral.com",
5
5
  "description": "Web SDK for viewing Vindral streams",
6
6
  "license": "SEE LICENSE IN https://www.vindral.com/terms-conditions",