@vindral/web-sdk 2.0.19 → 2.0.22

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
@@ -288,11 +288,9 @@ interface QualityOfServiceConfig {
288
288
  cooldownTime: number;
289
289
  maxBufferingEvents: {
290
290
  last10Seconds: number;
291
- last30Seconds: number;
292
291
  };
293
292
  maxBufferingRatio: {
294
293
  last10Seconds: number;
295
- last30Seconds: number;
296
294
  };
297
295
  maxRecentDowngradesCount: number;
298
296
  maxDowngradeLookbackMs: number;
@@ -391,6 +389,51 @@ declare class AudioPlayerModule {
391
389
  private getAudioContext;
392
390
  private setGain;
393
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
+ }
394
437
  interface VindralErrorProps {
395
438
  isFatal: boolean;
396
439
  code: string;
@@ -816,8 +859,11 @@ interface MseModuleListeners {
816
859
  }
817
860
  interface MseModuleStatistics {
818
861
  quotaErrorCount: number;
862
+ totalVideoFrames?: number;
863
+ droppedVideoFrames?: number;
819
864
  }
820
865
  declare class MseModule {
866
+ private readonly maxChunkSize;
821
867
  private logger;
822
868
  private timers;
823
869
  private emitter;
@@ -826,8 +872,6 @@ declare class MseModule {
826
872
  private mediaSource;
827
873
  private trackContexts;
828
874
  private autoRecoverFromMediaErrors;
829
- private pendingSamples;
830
- private isWorkingOnPendingSamples;
831
875
  private quotaErrorCount;
832
876
  constructor(logger: Logger, emitter: Emitter<MseModuleListeners, MseModuleEvents>, mediaElement: HTMLMediaElement, tracks: Track[]);
833
877
  static create: (logger: Logger, emitter: Emitter<MseModuleListeners, MseModuleEvents>, mediaElement: HTMLMediaElement, tracks: Track[]) => Promise<MseModule>;
@@ -836,9 +880,8 @@ declare class MseModule {
836
880
  private open;
837
881
  getBuffer: (type: Type) => TimeRange[];
838
882
  init: (initSegment: Readonly<InitSegment>) => void;
839
- append: (sample: Readonly<CodedSample>) => Promise<void>;
883
+ append: (samples: Readonly<CodedSample>[], needsInitSegment: boolean) => Promise<void>;
840
884
  private onCodedSample;
841
- private work;
842
885
  private onSourceEnded;
843
886
  }
844
887
  interface PictureInPictureListeners {
@@ -909,6 +952,7 @@ declare class QualityOfServiceModule {
909
952
  getBufferFullnessRegression: () => Regression | undefined;
910
953
  activeRatios: () => Map<string, number>;
911
954
  bufferingRatios: () => Map<string, number>;
955
+ bufferingEventsLast: (last: number) => number;
912
956
  timeSpentBufferingLast: (last: number) => number;
913
957
  timeSpentActiveLast: (last: number) => number;
914
958
  timeSpentPlayingInAtLeastLevelRatio: (renditionLevel: RenditionLevel) => number;
@@ -1073,8 +1117,9 @@ declare const defaultOptions: {
1073
1117
  maxAudioBitRate: number;
1074
1118
  tags: string[];
1075
1119
  media: Media;
1076
- posterEnabled: boolean;
1120
+ poster: string | boolean;
1077
1121
  reconnectHandler: (state: ReconnectState) => Promise<boolean> | boolean;
1122
+ iosWakeLockEnabled: boolean;
1078
1123
  advanced: {
1079
1124
  wasmDecodingConstraint: Partial<VideoConstraint>;
1080
1125
  };
@@ -1128,6 +1173,7 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
1128
1173
  private hasCalledConnect;
1129
1174
  private apiClient;
1130
1175
  private latestEmittedLanguages;
1176
+ private wakeLock;
1131
1177
  private durationSessions;
1132
1178
  constructor(options: Options);
1133
1179
  attach: (container: HTMLElement) => void;
@@ -1176,6 +1222,7 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
1176
1222
  get bufferingRatios(): Map<string, number>;
1177
1223
  get timeSpentBuffering(): number;
1178
1224
  get timeActive(): number;
1225
+ get mediaElement(): HTMLMediaElement | HTMLCanvasElement;
1179
1226
  getOptions: () => Options & typeof defaultOptions;
1180
1227
  getThumbnailUrl: () => string;
1181
1228
  updateAuthenticationToken: (token: string) => void;
@@ -1278,6 +1325,7 @@ interface ClockSource {
1278
1325
  }
1279
1326
  interface VideoPlayerStatistics {
1280
1327
  renderedFrameCount: number;
1328
+ rendererDroppedFrameCount: number;
1281
1329
  }
1282
1330
  declare class VideoPlayerModule {
1283
1331
  private logger;
@@ -1288,6 +1336,7 @@ declare class VideoPlayerModule {
1288
1336
  private isFirstFrame;
1289
1337
  private animationFrameRequest?;
1290
1338
  private renderedFrameCount;
1339
+ private rendererDroppedFrameCount;
1291
1340
  constructor(emitter: Emitter<VideoPlayerModuleListeners, unknown>, logger: Logger, clockSource: ClockSource);
1292
1341
  unload: () => Promise<void>;
1293
1342
  suspend: () => void;
@@ -1319,6 +1368,7 @@ export interface Modules {
1319
1368
  telemetry?: TelemetryModule;
1320
1369
  documentState: DocumentStateModule;
1321
1370
  incomingData: IncomingDataModule;
1371
+ bufferTime: BufferTimeModule;
1322
1372
  unpause?: UnpauseModule;
1323
1373
  }
1324
1374
  export interface ReconnectState {
@@ -1347,7 +1397,7 @@ export interface Options {
1347
1397
  maxSize?: Size;
1348
1398
  maxAudioBitRate?: number;
1349
1399
  maxVideoBitRate?: number;
1350
- posterEnabled?: boolean;
1400
+ poster?: boolean | string;
1351
1401
  muted?: boolean;
1352
1402
  reconnectHandler?: (state: ReconnectState) => Promise<boolean> | boolean;
1353
1403
  tags?: string[];
@@ -1355,6 +1405,7 @@ export interface Options {
1355
1405
  edgeUrl?: string;
1356
1406
  logShippingEnabled?: boolean;
1357
1407
  statsShippingEnabled?: boolean;
1408
+ iosWakeLockEnabled?: boolean;
1358
1409
  advanced?: AdvancedOptions;
1359
1410
  media?: Media;
1360
1411
  }
@@ -1514,6 +1565,7 @@ export interface ConnectResponse {
1514
1565
  export interface ApiClientOptions {
1515
1566
  publicEndpoint: string;
1516
1567
  tokenFactory?: AuthorizationTokenFactory;
1568
+ sessionId?: string;
1517
1569
  }
1518
1570
  export interface AuthorizationContext {
1519
1571
  channelGroupId?: string;
@@ -1523,10 +1575,12 @@ export declare type AuthorizationTokenFactory = (context: AuthorizationContext)
1523
1575
  export declare class ApiClient {
1524
1576
  private baseUrl;
1525
1577
  private tokenFactory?;
1578
+ private sessionId?;
1526
1579
  constructor(options: ApiClientOptions);
1527
1580
  connect(options: ConnectOptions): Promise<ConnectResponse>;
1528
1581
  getChannel(channelId: string): Promise<Channel>;
1529
1582
  getChannels(channelGroupId: string): Promise<Channel[]>;
1583
+ private getHeaders;
1530
1584
  private getAuthToken;
1531
1585
  private toChannels;
1532
1586
  private toChannel;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vindral/web-sdk",
3
- "version": "2.0.19",
3
+ "version": "2.0.22",
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",