@vindral/web-sdk 2.0.5 → 2.0.9
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/README.md +1 -1
- package/index.d.ts +251 -194
- package/package.json +1 -1
- package/web-sdk.esm.js +1 -1
- package/web-sdk.umd.js +1 -1
package/README.md
CHANGED
|
@@ -115,7 +115,7 @@ instance.on("playback state", (state) => (playbackState.textContent = state))
|
|
|
115
115
|
// This event is emitted when timed metadata events occur
|
|
116
116
|
instance.on("metadata", (metadata) => console.log("metadata: ", metadata.content))
|
|
117
117
|
|
|
118
|
-
// This event is emitted when the vindral detects that the browser requires a user initiated click event to start
|
|
118
|
+
// This event is emitted when the vindral detects that the browser requires a user initiated click event to start media playback
|
|
119
119
|
instance.on("needs user input", () => (button.style.display = "block"))
|
|
120
120
|
|
|
121
121
|
// Starts connecting to the channel
|
package/index.d.ts
CHANGED
|
@@ -85,6 +85,7 @@ declare class Emitter<TEvents, TEmits = TEvents, ArgLessEvents extends VoidKeys<
|
|
|
85
85
|
once<T extends ArgEvents>(eventName: T, fn: (args: TEvents[T]) => void): void;
|
|
86
86
|
private add;
|
|
87
87
|
}
|
|
88
|
+
declare type FilterFunc<T> = (item: T) => boolean;
|
|
88
89
|
declare class Fifo<T> {
|
|
89
90
|
readonly maxSize: number;
|
|
90
91
|
private values;
|
|
@@ -97,6 +98,7 @@ declare class Fifo<T> {
|
|
|
97
98
|
isFull: () => boolean;
|
|
98
99
|
isEmpty: () => boolean;
|
|
99
100
|
items: () => ReadonlyArray<T>;
|
|
101
|
+
filterPop: (filter: FilterFunc<T>) => void;
|
|
100
102
|
}
|
|
101
103
|
declare type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<T>;
|
|
102
104
|
interface MinMaxAverage {
|
|
@@ -267,11 +269,15 @@ declare class AdaptivityModule {
|
|
|
267
269
|
private tooMuchTimeBuffering;
|
|
268
270
|
private tooManyBufferingEvents;
|
|
269
271
|
}
|
|
272
|
+
interface NeedsUserInputContext {
|
|
273
|
+
forAudio: boolean;
|
|
274
|
+
forVideo: boolean;
|
|
275
|
+
}
|
|
270
276
|
interface AudioPlayerModuleListeners {
|
|
271
277
|
["decoded frame"]: Readonly<DecodedSample>;
|
|
272
278
|
}
|
|
273
279
|
interface AudioPlayerModuleEvents {
|
|
274
|
-
["needs user input"]:
|
|
280
|
+
["needs user input"]: NeedsUserInputContext;
|
|
275
281
|
}
|
|
276
282
|
interface ClockSource {
|
|
277
283
|
readonly currentTime: number;
|
|
@@ -283,8 +289,11 @@ declare class AudioPlayerModule {
|
|
|
283
289
|
private audio?;
|
|
284
290
|
private gainNode?;
|
|
285
291
|
private _volume;
|
|
292
|
+
private _userProvidedMuted;
|
|
293
|
+
private _muted;
|
|
286
294
|
private startTime;
|
|
287
295
|
private samples;
|
|
296
|
+
private preInitSampleQueue;
|
|
288
297
|
private sampleRate;
|
|
289
298
|
private channels;
|
|
290
299
|
private index;
|
|
@@ -299,11 +308,11 @@ declare class AudioPlayerModule {
|
|
|
299
308
|
set muted(muted: boolean);
|
|
300
309
|
get currentTime(): number;
|
|
301
310
|
set currentTime(currentTime: number);
|
|
302
|
-
constructor(emitter: Emitter<AudioPlayerModuleListeners, AudioPlayerModuleEvents>, logger: Logger, clockSource: ClockSource);
|
|
311
|
+
constructor(emitter: Emitter<AudioPlayerModuleListeners, AudioPlayerModuleEvents>, logger: Logger, clockSource: ClockSource, muted: boolean);
|
|
303
312
|
unload: () => Promise<void>;
|
|
304
313
|
suspend: () => void;
|
|
305
314
|
unsuspend: () => void;
|
|
306
|
-
static create: (emitter: Emitter<AudioPlayerModuleListeners, AudioPlayerModuleEvents>, logger: Logger, clockSource: ClockSource) => AudioPlayerModule;
|
|
315
|
+
static create: (emitter: Emitter<AudioPlayerModuleListeners, AudioPlayerModuleEvents>, logger: Logger, clockSource: ClockSource, muted: boolean) => AudioPlayerModule;
|
|
307
316
|
private flush;
|
|
308
317
|
private onDecodedFrame;
|
|
309
318
|
play: () => Promise<void>;
|
|
@@ -339,10 +348,8 @@ export declare const authenticationExpiredError: () => VindralError;
|
|
|
339
348
|
export declare const inactivityError: () => VindralError;
|
|
340
349
|
export declare const channelNotFoundError: () => VindralError;
|
|
341
350
|
export declare const noIncomingDataError: () => VindralError;
|
|
342
|
-
export declare const unableToConnectError: () => VindralError;
|
|
351
|
+
export declare const unableToConnectError: (source?: Error | undefined) => VindralError;
|
|
343
352
|
export declare const unableToConnectAfterRetriesError: () => VindralError;
|
|
344
|
-
export declare const isValidOptions: (options: unknown) => options is Options;
|
|
345
|
-
export declare const validateOptions: (options: Options) => Options;
|
|
346
353
|
declare type State = "connected" | "disconnected" | "connecting";
|
|
347
354
|
interface ConnectionModuleListeners {
|
|
348
355
|
["send signal"]: Readonly<string>;
|
|
@@ -403,6 +410,13 @@ declare class ConnectionModule {
|
|
|
403
410
|
reconnect: (reason: string) => void;
|
|
404
411
|
private sendPing;
|
|
405
412
|
}
|
|
413
|
+
interface Size {
|
|
414
|
+
width: number;
|
|
415
|
+
height: number;
|
|
416
|
+
}
|
|
417
|
+
interface PictureInPictureSizeSource {
|
|
418
|
+
getPictureInPictureSize(): Size | undefined;
|
|
419
|
+
}
|
|
406
420
|
export interface RenditionLevel {
|
|
407
421
|
audio?: AudioRendition;
|
|
408
422
|
video?: VideoRendition;
|
|
@@ -477,192 +491,6 @@ declare class RenditionsModule {
|
|
|
477
491
|
private createRenditionLevels;
|
|
478
492
|
private getCurrentSubscription;
|
|
479
493
|
}
|
|
480
|
-
interface Size {
|
|
481
|
-
width: number;
|
|
482
|
-
height: number;
|
|
483
|
-
}
|
|
484
|
-
interface SubscriptionModuleListeners {
|
|
485
|
-
["subscription changed"]: Readonly<SubscriptionChange>;
|
|
486
|
-
}
|
|
487
|
-
declare class SubscriptionModule {
|
|
488
|
-
private logger;
|
|
489
|
-
private timers;
|
|
490
|
-
private emitter;
|
|
491
|
-
private targetSubscription;
|
|
492
|
-
private currentSubscription;
|
|
493
|
-
private _isSwitchingSubscription;
|
|
494
|
-
private pendingSubscriptionTimeoutId?;
|
|
495
|
-
private constructor();
|
|
496
|
-
unload: () => void;
|
|
497
|
-
static create: (logger: Logger, emitter: Emitter<SubscriptionModuleListeners>, subscription: Subscription) => SubscriptionModule;
|
|
498
|
-
isSwitchingSubscription: () => boolean;
|
|
499
|
-
getTargetSubscription: () => Subscription;
|
|
500
|
-
getCurrentSubscription: () => Subscription;
|
|
501
|
-
setSize: (size: Readonly<Size>) => void;
|
|
502
|
-
setVideoConstraint: (constraint: VideoConstraint) => void;
|
|
503
|
-
setAudioConstraint: (constraint: AudioConstraint) => void;
|
|
504
|
-
setVideoBitRate: (bitRate: number) => void;
|
|
505
|
-
setAudioBitRate: (bitRate: number) => void;
|
|
506
|
-
setChannelId: (channelId: string) => void;
|
|
507
|
-
setLanguage: (language: string | undefined) => void;
|
|
508
|
-
setVideoCodec: (videoCodec: VideoCodec | undefined) => void;
|
|
509
|
-
setAudioCodec: (audioCodec: AudioCodec | undefined) => void;
|
|
510
|
-
private onSubscriptionChanged;
|
|
511
|
-
private scheduleSubscriptionChange;
|
|
512
|
-
}
|
|
513
|
-
interface UserAgentInformation {
|
|
514
|
-
userAgent: string;
|
|
515
|
-
locationOrigin: string;
|
|
516
|
-
locationPath: string;
|
|
517
|
-
ancestorOrigins?: string[];
|
|
518
|
-
}
|
|
519
|
-
declare type StatisticsType<K> = K extends {
|
|
520
|
-
getStatistics: () => unknown;
|
|
521
|
-
} ? ReturnType<K["getStatistics"]> : never;
|
|
522
|
-
declare type StatisticsTypes = {
|
|
523
|
-
[Property in keyof Modules]: StatisticsType<Modules[Property]>;
|
|
524
|
-
};
|
|
525
|
-
export declare type ModuleStatistics = Flatten<StatisticsTypes>;
|
|
526
|
-
export declare type Statistics = ModuleStatistics & UserAgentInformation & {
|
|
527
|
-
version: string;
|
|
528
|
-
ip?: string;
|
|
529
|
-
url: string;
|
|
530
|
-
sessionId: string;
|
|
531
|
-
uptime: number;
|
|
532
|
-
videoBitRate?: number;
|
|
533
|
-
audioBitRate?: number;
|
|
534
|
-
bytesReceived: number;
|
|
535
|
-
channelId: string;
|
|
536
|
-
channelGroupId?: string;
|
|
537
|
-
timeToFirstFrame?: number;
|
|
538
|
-
};
|
|
539
|
-
export declare class Vindral extends Emitter<PublicVindralEvents> {
|
|
540
|
-
private static INITIAL_MAX_BIT_RATE;
|
|
541
|
-
readonly pictureInPicture: {
|
|
542
|
-
enter: () => Promise<void>;
|
|
543
|
-
exit: () => Promise<void>;
|
|
544
|
-
isActive: () => boolean;
|
|
545
|
-
isSupported: () => boolean;
|
|
546
|
-
};
|
|
547
|
-
readonly cast: {
|
|
548
|
-
init: () => Promise<void>;
|
|
549
|
-
start: () => void;
|
|
550
|
-
stop: () => void;
|
|
551
|
-
};
|
|
552
|
-
private browser;
|
|
553
|
-
private options;
|
|
554
|
-
private element;
|
|
555
|
-
private playbackSource;
|
|
556
|
-
private emitter;
|
|
557
|
-
private logger;
|
|
558
|
-
private modules;
|
|
559
|
-
private clientIp?;
|
|
560
|
-
private sessionId;
|
|
561
|
-
private _channels;
|
|
562
|
-
private createdAt;
|
|
563
|
-
private hasCalledConnect;
|
|
564
|
-
private apiClient;
|
|
565
|
-
private durationSessions;
|
|
566
|
-
constructor(options: Options);
|
|
567
|
-
attach: (container: HTMLElement) => void;
|
|
568
|
-
set volume(volume: number);
|
|
569
|
-
get volume(): number;
|
|
570
|
-
get videoBitRate(): number;
|
|
571
|
-
get audioBitRate(): number;
|
|
572
|
-
get connectionState(): Readonly<State>;
|
|
573
|
-
get playbackState(): Readonly<PlaybackState>;
|
|
574
|
-
get bufferFullness(): number;
|
|
575
|
-
get abrEnabled(): boolean;
|
|
576
|
-
set abrEnabled(enabled: boolean);
|
|
577
|
-
get serverEdgeTime(): number | undefined;
|
|
578
|
-
get serverWallclockTime(): number | undefined;
|
|
579
|
-
get currentTime(): number;
|
|
580
|
-
get targetBufferTime(): number;
|
|
581
|
-
set targetBufferTime(bufferTimeMs: number);
|
|
582
|
-
get playbackLatency(): number | undefined;
|
|
583
|
-
get playbackWallclockTime(): number | undefined;
|
|
584
|
-
get channels(): ReadonlyArray<Channel>;
|
|
585
|
-
get languages(): ReadonlyArray<string>;
|
|
586
|
-
get language(): string | undefined;
|
|
587
|
-
set language(language: string | undefined);
|
|
588
|
-
get channelId(): string;
|
|
589
|
-
set channelId(channelId: string);
|
|
590
|
-
get maxSize(): Size;
|
|
591
|
-
set maxSize(size: Size);
|
|
592
|
-
get maxBitRate(): number;
|
|
593
|
-
set maxBitRate(bitRate: number);
|
|
594
|
-
get maxVideoBitrate(): number;
|
|
595
|
-
set maxVideoBitrate(bitRate: number);
|
|
596
|
-
get maxAudioBitrate(): number;
|
|
597
|
-
set maxAudioBitrate(bitRate: number);
|
|
598
|
-
get renditionLevels(): ReadonlyArray<RenditionLevel>;
|
|
599
|
-
get currentRenditionLevel(): Readonly<RenditionLevel> | undefined;
|
|
600
|
-
get targetRenditionLevel(): Readonly<RenditionLevel> | undefined;
|
|
601
|
-
get isSwitchingRenditionLevel(): boolean;
|
|
602
|
-
get videoBufferedRanges(): ReadonlyArray<TimeRange>;
|
|
603
|
-
get audioBufferedRanges(): ReadonlyArray<TimeRange>;
|
|
604
|
-
get lastBufferEvent(): Readonly<BufferStateEvent>;
|
|
605
|
-
get activeRatios(): Map<string, number>;
|
|
606
|
-
get bufferingRatios(): Map<string, number>;
|
|
607
|
-
get timeSpentBuffering(): number;
|
|
608
|
-
get timeActive(): number;
|
|
609
|
-
updateAuthenticationToken: (token: string) => void;
|
|
610
|
-
connect: () => void;
|
|
611
|
-
private connectionInfo;
|
|
612
|
-
private connectHandler;
|
|
613
|
-
private filterRenditions;
|
|
614
|
-
private patchSubscription;
|
|
615
|
-
private isSupportedVideoCodecProfile;
|
|
616
|
-
private supportedAudioCodecs;
|
|
617
|
-
private initializeDecodingModule;
|
|
618
|
-
unload: () => Promise<void>;
|
|
619
|
-
userInput: () => void;
|
|
620
|
-
private play;
|
|
621
|
-
get uptime(): number;
|
|
622
|
-
getStatistics: () => Statistics;
|
|
623
|
-
private onBufferEvent;
|
|
624
|
-
private alignSizeAndBitRate;
|
|
625
|
-
private get currentSubscription();
|
|
626
|
-
private get targetSubscription();
|
|
627
|
-
private timeToFirstFrame;
|
|
628
|
-
private willUseMediaSource;
|
|
629
|
-
}
|
|
630
|
-
interface CastModuleListeners {
|
|
631
|
-
["cast"]: void;
|
|
632
|
-
}
|
|
633
|
-
interface CastModuleEvents {
|
|
634
|
-
["cast started"]: void;
|
|
635
|
-
["cast resumed"]: void;
|
|
636
|
-
["cast stopped"]: void;
|
|
637
|
-
["cast failed"]: void;
|
|
638
|
-
}
|
|
639
|
-
interface CastConfig {
|
|
640
|
-
options: Options;
|
|
641
|
-
background?: string;
|
|
642
|
-
receiverApplicationId?: string;
|
|
643
|
-
}
|
|
644
|
-
declare class CastModule {
|
|
645
|
-
private emitter;
|
|
646
|
-
private logger;
|
|
647
|
-
private state;
|
|
648
|
-
get volume(): number;
|
|
649
|
-
set volume(volume: number);
|
|
650
|
-
constructor(emitter: Emitter<CastModuleListeners, CastModuleEvents>, logger: Logger);
|
|
651
|
-
static create: (emitter: Emitter<CastModuleListeners, CastModuleEvents>, logger: Logger) => CastModule;
|
|
652
|
-
unload: () => void;
|
|
653
|
-
start: (config: CastConfig) => Promise<void>;
|
|
654
|
-
stop: () => void;
|
|
655
|
-
private onGCastApiAvailable;
|
|
656
|
-
private onSessionStateChanged;
|
|
657
|
-
private getInstance;
|
|
658
|
-
}
|
|
659
|
-
interface Size {
|
|
660
|
-
width: number;
|
|
661
|
-
height: number;
|
|
662
|
-
}
|
|
663
|
-
interface PictureInPictureSizeSource {
|
|
664
|
-
getPictureInPictureSize(): Size | undefined;
|
|
665
|
-
}
|
|
666
494
|
declare type DeepPartial<T> = {
|
|
667
495
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
668
496
|
};
|
|
@@ -996,6 +824,39 @@ declare class QualityOfServiceModule {
|
|
|
996
824
|
private setActive;
|
|
997
825
|
private unsetActive;
|
|
998
826
|
}
|
|
827
|
+
interface Size {
|
|
828
|
+
width: number;
|
|
829
|
+
height: number;
|
|
830
|
+
}
|
|
831
|
+
interface SubscriptionModuleListeners {
|
|
832
|
+
["subscription changed"]: Readonly<SubscriptionChange>;
|
|
833
|
+
}
|
|
834
|
+
declare class SubscriptionModule {
|
|
835
|
+
private logger;
|
|
836
|
+
private timers;
|
|
837
|
+
private emitter;
|
|
838
|
+
private targetSubscription;
|
|
839
|
+
private currentSubscription;
|
|
840
|
+
private _isSwitchingSubscription;
|
|
841
|
+
private pendingSubscriptionTimeoutId?;
|
|
842
|
+
private constructor();
|
|
843
|
+
unload: () => void;
|
|
844
|
+
static create: (logger: Logger, emitter: Emitter<SubscriptionModuleListeners>, subscription: Subscription) => SubscriptionModule;
|
|
845
|
+
isSwitchingSubscription: () => boolean;
|
|
846
|
+
getTargetSubscription: () => Subscription;
|
|
847
|
+
getCurrentSubscription: () => Subscription;
|
|
848
|
+
setSize: (size: Readonly<Size>) => void;
|
|
849
|
+
setVideoConstraint: (constraint: VideoConstraint) => void;
|
|
850
|
+
setAudioConstraint: (constraint: AudioConstraint) => void;
|
|
851
|
+
setVideoBitRate: (bitRate: number) => void;
|
|
852
|
+
setAudioBitRate: (bitRate: number) => void;
|
|
853
|
+
setChannelId: (channelId: string) => void;
|
|
854
|
+
setLanguage: (language: string | undefined) => void;
|
|
855
|
+
setVideoCodec: (videoCodec: VideoCodec | undefined) => void;
|
|
856
|
+
setAudioCodec: (audioCodec: AudioCodec | undefined) => void;
|
|
857
|
+
private onSubscriptionChanged;
|
|
858
|
+
private scheduleSubscriptionChange;
|
|
859
|
+
}
|
|
999
860
|
interface SyncSample {
|
|
1000
861
|
type: Type;
|
|
1001
862
|
isSync: boolean;
|
|
@@ -1081,6 +942,143 @@ declare class SyncModule {
|
|
|
1081
942
|
number
|
|
1082
943
|
];
|
|
1083
944
|
}
|
|
945
|
+
declare const defaultOptions: {
|
|
946
|
+
sizeBasedResolutionCapEnabled: boolean;
|
|
947
|
+
pictureInPictureEnabled: boolean;
|
|
948
|
+
abrEnabled: boolean;
|
|
949
|
+
mseEnabled: boolean;
|
|
950
|
+
mseOpusEnabled: boolean;
|
|
951
|
+
muted: boolean;
|
|
952
|
+
minBufferTime: number;
|
|
953
|
+
maxBufferTime: number;
|
|
954
|
+
logLevel: Level;
|
|
955
|
+
maxSize: Size;
|
|
956
|
+
maxVideoBitRate: number;
|
|
957
|
+
maxAudioBitRate: number;
|
|
958
|
+
tags: string[];
|
|
959
|
+
media: Media;
|
|
960
|
+
reconnectHandler: (state: ReconnectState) => Promise<boolean> | boolean;
|
|
961
|
+
advanced: {
|
|
962
|
+
wasmDecodingConstraint: Partial<VideoConstraint>;
|
|
963
|
+
};
|
|
964
|
+
};
|
|
965
|
+
interface UserAgentInformation {
|
|
966
|
+
userAgent: string;
|
|
967
|
+
locationOrigin: string;
|
|
968
|
+
locationPath: string;
|
|
969
|
+
ancestorOrigins?: string[];
|
|
970
|
+
}
|
|
971
|
+
declare type StatisticsType<K> = K extends {
|
|
972
|
+
getStatistics: () => unknown;
|
|
973
|
+
} ? ReturnType<K["getStatistics"]> : never;
|
|
974
|
+
declare type StatisticsTypes = {
|
|
975
|
+
[Property in keyof Modules]: StatisticsType<Modules[Property]>;
|
|
976
|
+
};
|
|
977
|
+
export declare type ModuleStatistics = Flatten<StatisticsTypes>;
|
|
978
|
+
export declare type Statistics = ModuleStatistics & UserAgentInformation & {
|
|
979
|
+
version: string;
|
|
980
|
+
ip?: string;
|
|
981
|
+
url: string;
|
|
982
|
+
sessionId: string;
|
|
983
|
+
uptime: number;
|
|
984
|
+
videoBitRate?: number;
|
|
985
|
+
audioBitRate?: number;
|
|
986
|
+
bytesReceived: number;
|
|
987
|
+
channelId: string;
|
|
988
|
+
channelGroupId?: string;
|
|
989
|
+
timeToFirstFrame?: number;
|
|
990
|
+
};
|
|
991
|
+
export declare class Vindral extends Emitter<PublicVindralEvents> {
|
|
992
|
+
private static INITIAL_MAX_BIT_RATE;
|
|
993
|
+
readonly pictureInPicture: {
|
|
994
|
+
enter: () => Promise<void>;
|
|
995
|
+
exit: () => Promise<void>;
|
|
996
|
+
isActive: () => boolean;
|
|
997
|
+
isSupported: () => boolean;
|
|
998
|
+
};
|
|
999
|
+
private browser;
|
|
1000
|
+
private options;
|
|
1001
|
+
private element;
|
|
1002
|
+
private playbackSource;
|
|
1003
|
+
private emitter;
|
|
1004
|
+
private logger;
|
|
1005
|
+
private modules;
|
|
1006
|
+
private clientIp?;
|
|
1007
|
+
private sessionId;
|
|
1008
|
+
private _channels;
|
|
1009
|
+
private createdAt;
|
|
1010
|
+
private hasCalledConnect;
|
|
1011
|
+
private apiClient;
|
|
1012
|
+
private durationSessions;
|
|
1013
|
+
constructor(options: Options);
|
|
1014
|
+
attach: (container: HTMLElement) => void;
|
|
1015
|
+
set volume(volume: number);
|
|
1016
|
+
get volume(): number;
|
|
1017
|
+
set muted(muted: boolean);
|
|
1018
|
+
get muted(): boolean;
|
|
1019
|
+
get media(): Media;
|
|
1020
|
+
get videoBitRate(): number;
|
|
1021
|
+
get audioBitRate(): number;
|
|
1022
|
+
get connectionState(): Readonly<State>;
|
|
1023
|
+
get playbackState(): Readonly<PlaybackState>;
|
|
1024
|
+
get bufferFullness(): number;
|
|
1025
|
+
get abrEnabled(): boolean;
|
|
1026
|
+
set abrEnabled(enabled: boolean);
|
|
1027
|
+
get serverEdgeTime(): number | undefined;
|
|
1028
|
+
get serverWallclockTime(): number | undefined;
|
|
1029
|
+
get currentTime(): number;
|
|
1030
|
+
get targetBufferTime(): number;
|
|
1031
|
+
set targetBufferTime(bufferTimeMs: number);
|
|
1032
|
+
get playbackLatency(): number | undefined;
|
|
1033
|
+
get playbackWallclockTime(): number | undefined;
|
|
1034
|
+
get channels(): ReadonlyArray<Channel>;
|
|
1035
|
+
get languages(): ReadonlyArray<string>;
|
|
1036
|
+
get language(): string | undefined;
|
|
1037
|
+
set language(language: string | undefined);
|
|
1038
|
+
get channelId(): string;
|
|
1039
|
+
set channelId(channelId: string);
|
|
1040
|
+
get maxSize(): Size;
|
|
1041
|
+
set maxSize(size: Size);
|
|
1042
|
+
get maxBitRate(): number;
|
|
1043
|
+
set maxBitRate(bitRate: number);
|
|
1044
|
+
get maxVideoBitrate(): number;
|
|
1045
|
+
set maxVideoBitrate(bitRate: number);
|
|
1046
|
+
get maxAudioBitrate(): number;
|
|
1047
|
+
set maxAudioBitrate(bitRate: number);
|
|
1048
|
+
get renditionLevels(): ReadonlyArray<RenditionLevel>;
|
|
1049
|
+
get currentRenditionLevel(): Readonly<RenditionLevel> | undefined;
|
|
1050
|
+
get targetRenditionLevel(): Readonly<RenditionLevel> | undefined;
|
|
1051
|
+
get isSwitchingRenditionLevel(): boolean;
|
|
1052
|
+
get videoBufferedRanges(): ReadonlyArray<TimeRange>;
|
|
1053
|
+
get audioBufferedRanges(): ReadonlyArray<TimeRange>;
|
|
1054
|
+
get lastBufferEvent(): Readonly<BufferStateEvent>;
|
|
1055
|
+
get activeRatios(): Map<string, number>;
|
|
1056
|
+
get bufferingRatios(): Map<string, number>;
|
|
1057
|
+
get timeSpentBuffering(): number;
|
|
1058
|
+
get timeActive(): number;
|
|
1059
|
+
getOptions: () => Options & typeof defaultOptions;
|
|
1060
|
+
updateAuthenticationToken: (token: string) => void;
|
|
1061
|
+
connect: () => void;
|
|
1062
|
+
getCastOptions: () => Options;
|
|
1063
|
+
private connectionInfo;
|
|
1064
|
+
private connectHandler;
|
|
1065
|
+
private filterRenditions;
|
|
1066
|
+
private patchSubscription;
|
|
1067
|
+
private isSupportedVideoCodecProfile;
|
|
1068
|
+
private supportedAudioCodecs;
|
|
1069
|
+
private initializeDecodingModule;
|
|
1070
|
+
unload: () => Promise<void>;
|
|
1071
|
+
userInput: () => void;
|
|
1072
|
+
private play;
|
|
1073
|
+
get uptime(): number;
|
|
1074
|
+
getStatistics: () => Statistics;
|
|
1075
|
+
private onBufferEvent;
|
|
1076
|
+
private alignSizeAndBitRate;
|
|
1077
|
+
private get currentSubscription();
|
|
1078
|
+
private get targetSubscription();
|
|
1079
|
+
private timeToFirstFrame;
|
|
1080
|
+
private willUseMediaSource;
|
|
1081
|
+
}
|
|
1084
1082
|
interface TelemetryModuleOptions {
|
|
1085
1083
|
url: string;
|
|
1086
1084
|
interval?: number;
|
|
@@ -1184,7 +1182,6 @@ export interface Modules {
|
|
|
1184
1182
|
qualityOfService: QualityOfServiceModule;
|
|
1185
1183
|
metadata: MetadataModule;
|
|
1186
1184
|
sync: SyncModule;
|
|
1187
|
-
cast: CastModule;
|
|
1188
1185
|
telemetry?: TelemetryModule;
|
|
1189
1186
|
documentState: DocumentStateModule;
|
|
1190
1187
|
incomingData: IncomingDataModule;
|
|
@@ -1235,7 +1232,7 @@ export interface PlaybackSource {
|
|
|
1235
1232
|
}
|
|
1236
1233
|
export interface PublicVindralEvents {
|
|
1237
1234
|
["error"]: Readonly<VindralError>;
|
|
1238
|
-
["needs user input"]:
|
|
1235
|
+
["needs user input"]: NeedsUserInputContext;
|
|
1239
1236
|
["metadata"]: Readonly<Metadata>;
|
|
1240
1237
|
["playback state"]: Readonly<PlaybackState>;
|
|
1241
1238
|
["connection state"]: Readonly<State>;
|
|
@@ -1400,6 +1397,60 @@ export declare class ApiClient {
|
|
|
1400
1397
|
private toChannels;
|
|
1401
1398
|
private toChannel;
|
|
1402
1399
|
}
|
|
1400
|
+
export declare type CastState = "casting" | "not casting";
|
|
1401
|
+
export interface CastSenderEvents {
|
|
1402
|
+
["connected"]: void;
|
|
1403
|
+
["resumed"]: void;
|
|
1404
|
+
["disconnected"]: void;
|
|
1405
|
+
["failed"]: void;
|
|
1406
|
+
["metadata"]: Metadata;
|
|
1407
|
+
["server wallclock time"]: number;
|
|
1408
|
+
}
|
|
1409
|
+
export interface CastConfig {
|
|
1410
|
+
options: Options;
|
|
1411
|
+
background?: string;
|
|
1412
|
+
receiverApplicationId?: string;
|
|
1413
|
+
}
|
|
1414
|
+
export declare type CustomCastMessageType = "stop" | "start" | "updateAuthToken" | "serverWallclockTime" | "metadata" | "setChannelId" | "setLanguage";
|
|
1415
|
+
export interface CastCustomMessage {
|
|
1416
|
+
type: CustomCastMessageType;
|
|
1417
|
+
channelId?: string;
|
|
1418
|
+
language?: string;
|
|
1419
|
+
config?: CastConfig;
|
|
1420
|
+
token?: string;
|
|
1421
|
+
serverWallclockTime?: number;
|
|
1422
|
+
metadata?: Metadata;
|
|
1423
|
+
}
|
|
1424
|
+
export declare class CastSender extends Emitter<CastSenderEvents> {
|
|
1425
|
+
private state;
|
|
1426
|
+
private config;
|
|
1427
|
+
private unloaded;
|
|
1428
|
+
constructor(config: CastConfig);
|
|
1429
|
+
get casting(): boolean;
|
|
1430
|
+
get volume(): number;
|
|
1431
|
+
set volume(volume: number);
|
|
1432
|
+
get language(): string | undefined;
|
|
1433
|
+
set language(language: string | undefined);
|
|
1434
|
+
get channelId(): string;
|
|
1435
|
+
set channelId(channelId: string);
|
|
1436
|
+
updateAuthenticationToken: (token: string) => void;
|
|
1437
|
+
unload: () => void;
|
|
1438
|
+
init: () => Promise<void>;
|
|
1439
|
+
start: () => Promise<void>;
|
|
1440
|
+
stop: () => void;
|
|
1441
|
+
private onGCastApiAvailable;
|
|
1442
|
+
private send;
|
|
1443
|
+
private onMessage;
|
|
1444
|
+
private onSessionStarted;
|
|
1445
|
+
private onSessionStateChanged;
|
|
1446
|
+
private getInstance;
|
|
1447
|
+
private getSession;
|
|
1448
|
+
private getReceiverName;
|
|
1449
|
+
private castLibrariesAdded;
|
|
1450
|
+
private verifyCastLibraries;
|
|
1451
|
+
}
|
|
1452
|
+
export declare const isValidOptions: (options: unknown) => options is Options;
|
|
1453
|
+
export declare const validateOptions: (options: Options) => Options;
|
|
1403
1454
|
interface FullscreenEvents {
|
|
1404
1455
|
["on fullscreen change"]: boolean;
|
|
1405
1456
|
}
|
|
@@ -1417,6 +1468,7 @@ declare class Fullscreen extends Emitter<FullscreenEvents> {
|
|
|
1417
1468
|
}
|
|
1418
1469
|
export interface PlayerOptions {
|
|
1419
1470
|
controlsEnabled?: boolean;
|
|
1471
|
+
castEnabled?: boolean;
|
|
1420
1472
|
fullscreenButtonEnabled?: boolean;
|
|
1421
1473
|
pipButtonEnabled?: boolean;
|
|
1422
1474
|
channelSelectionEnabled?: boolean;
|
|
@@ -1424,6 +1476,8 @@ export interface PlayerOptions {
|
|
|
1424
1476
|
languagesButtonEnabled?: boolean;
|
|
1425
1477
|
oneToOneButtonEnabled?: boolean;
|
|
1426
1478
|
hideTimeout?: number;
|
|
1479
|
+
castBackground?: string;
|
|
1480
|
+
castReceiverApplicationId?: string;
|
|
1427
1481
|
}
|
|
1428
1482
|
export interface PlayerState {
|
|
1429
1483
|
isBuffering: boolean;
|
|
@@ -1432,16 +1486,19 @@ export interface PlayerState {
|
|
|
1432
1486
|
}
|
|
1433
1487
|
export declare class Player {
|
|
1434
1488
|
readonly core: Vindral;
|
|
1489
|
+
readonly castSender: CastSender;
|
|
1435
1490
|
private options;
|
|
1436
1491
|
private state;
|
|
1437
1492
|
private playerElement;
|
|
1438
1493
|
private bufferingOverlay;
|
|
1494
|
+
private playOverlay;
|
|
1439
1495
|
private bar;
|
|
1440
1496
|
private stateInterval?;
|
|
1441
1497
|
private showBufferingTimeout?;
|
|
1442
1498
|
constructor(optionsOrInstance: Options | Vindral, playerOptions?: PlayerOptions);
|
|
1443
1499
|
unload: () => void;
|
|
1444
1500
|
attach: (container: HTMLElement) => void;
|
|
1501
|
+
private setupCastSender;
|
|
1445
1502
|
private onMouseMove;
|
|
1446
1503
|
private onClick;
|
|
1447
1504
|
private togglePip;
|
package/package.json
CHANGED