@vindral/web-sdk 2.0.6 → 2.0.7
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 +247 -193
- 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
|
@@ -267,11 +267,15 @@ declare class AdaptivityModule {
|
|
|
267
267
|
private tooMuchTimeBuffering;
|
|
268
268
|
private tooManyBufferingEvents;
|
|
269
269
|
}
|
|
270
|
+
interface NeedsUserInputContext {
|
|
271
|
+
forAudio: boolean;
|
|
272
|
+
forVideo: boolean;
|
|
273
|
+
}
|
|
270
274
|
interface AudioPlayerModuleListeners {
|
|
271
275
|
["decoded frame"]: Readonly<DecodedSample>;
|
|
272
276
|
}
|
|
273
277
|
interface AudioPlayerModuleEvents {
|
|
274
|
-
["needs user input"]:
|
|
278
|
+
["needs user input"]: NeedsUserInputContext;
|
|
275
279
|
}
|
|
276
280
|
interface ClockSource {
|
|
277
281
|
readonly currentTime: number;
|
|
@@ -283,6 +287,8 @@ declare class AudioPlayerModule {
|
|
|
283
287
|
private audio?;
|
|
284
288
|
private gainNode?;
|
|
285
289
|
private _volume;
|
|
290
|
+
private _userProvidedMuted;
|
|
291
|
+
private _muted;
|
|
286
292
|
private startTime;
|
|
287
293
|
private samples;
|
|
288
294
|
private sampleRate;
|
|
@@ -299,11 +305,11 @@ declare class AudioPlayerModule {
|
|
|
299
305
|
set muted(muted: boolean);
|
|
300
306
|
get currentTime(): number;
|
|
301
307
|
set currentTime(currentTime: number);
|
|
302
|
-
constructor(emitter: Emitter<AudioPlayerModuleListeners, AudioPlayerModuleEvents>, logger: Logger, clockSource: ClockSource);
|
|
308
|
+
constructor(emitter: Emitter<AudioPlayerModuleListeners, AudioPlayerModuleEvents>, logger: Logger, clockSource: ClockSource, muted: boolean);
|
|
303
309
|
unload: () => Promise<void>;
|
|
304
310
|
suspend: () => void;
|
|
305
311
|
unsuspend: () => void;
|
|
306
|
-
static create: (emitter: Emitter<AudioPlayerModuleListeners, AudioPlayerModuleEvents>, logger: Logger, clockSource: ClockSource) => AudioPlayerModule;
|
|
312
|
+
static create: (emitter: Emitter<AudioPlayerModuleListeners, AudioPlayerModuleEvents>, logger: Logger, clockSource: ClockSource, muted: boolean) => AudioPlayerModule;
|
|
307
313
|
private flush;
|
|
308
314
|
private onDecodedFrame;
|
|
309
315
|
play: () => Promise<void>;
|
|
@@ -341,8 +347,6 @@ export declare const channelNotFoundError: () => VindralError;
|
|
|
341
347
|
export declare const noIncomingDataError: () => VindralError;
|
|
342
348
|
export declare const unableToConnectError: () => VindralError;
|
|
343
349
|
export declare const unableToConnectAfterRetriesError: () => VindralError;
|
|
344
|
-
export declare const isValidOptions: (options: unknown) => options is Options;
|
|
345
|
-
export declare const validateOptions: (options: Options) => Options;
|
|
346
350
|
declare type State = "connected" | "disconnected" | "connecting";
|
|
347
351
|
interface ConnectionModuleListeners {
|
|
348
352
|
["send signal"]: Readonly<string>;
|
|
@@ -403,6 +407,13 @@ declare class ConnectionModule {
|
|
|
403
407
|
reconnect: (reason: string) => void;
|
|
404
408
|
private sendPing;
|
|
405
409
|
}
|
|
410
|
+
interface Size {
|
|
411
|
+
width: number;
|
|
412
|
+
height: number;
|
|
413
|
+
}
|
|
414
|
+
interface PictureInPictureSizeSource {
|
|
415
|
+
getPictureInPictureSize(): Size | undefined;
|
|
416
|
+
}
|
|
406
417
|
export interface RenditionLevel {
|
|
407
418
|
audio?: AudioRendition;
|
|
408
419
|
video?: VideoRendition;
|
|
@@ -477,192 +488,6 @@ declare class RenditionsModule {
|
|
|
477
488
|
private createRenditionLevels;
|
|
478
489
|
private getCurrentSubscription;
|
|
479
490
|
}
|
|
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
491
|
declare type DeepPartial<T> = {
|
|
667
492
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
668
493
|
};
|
|
@@ -996,6 +821,39 @@ declare class QualityOfServiceModule {
|
|
|
996
821
|
private setActive;
|
|
997
822
|
private unsetActive;
|
|
998
823
|
}
|
|
824
|
+
interface Size {
|
|
825
|
+
width: number;
|
|
826
|
+
height: number;
|
|
827
|
+
}
|
|
828
|
+
interface SubscriptionModuleListeners {
|
|
829
|
+
["subscription changed"]: Readonly<SubscriptionChange>;
|
|
830
|
+
}
|
|
831
|
+
declare class SubscriptionModule {
|
|
832
|
+
private logger;
|
|
833
|
+
private timers;
|
|
834
|
+
private emitter;
|
|
835
|
+
private targetSubscription;
|
|
836
|
+
private currentSubscription;
|
|
837
|
+
private _isSwitchingSubscription;
|
|
838
|
+
private pendingSubscriptionTimeoutId?;
|
|
839
|
+
private constructor();
|
|
840
|
+
unload: () => void;
|
|
841
|
+
static create: (logger: Logger, emitter: Emitter<SubscriptionModuleListeners>, subscription: Subscription) => SubscriptionModule;
|
|
842
|
+
isSwitchingSubscription: () => boolean;
|
|
843
|
+
getTargetSubscription: () => Subscription;
|
|
844
|
+
getCurrentSubscription: () => Subscription;
|
|
845
|
+
setSize: (size: Readonly<Size>) => void;
|
|
846
|
+
setVideoConstraint: (constraint: VideoConstraint) => void;
|
|
847
|
+
setAudioConstraint: (constraint: AudioConstraint) => void;
|
|
848
|
+
setVideoBitRate: (bitRate: number) => void;
|
|
849
|
+
setAudioBitRate: (bitRate: number) => void;
|
|
850
|
+
setChannelId: (channelId: string) => void;
|
|
851
|
+
setLanguage: (language: string | undefined) => void;
|
|
852
|
+
setVideoCodec: (videoCodec: VideoCodec | undefined) => void;
|
|
853
|
+
setAudioCodec: (audioCodec: AudioCodec | undefined) => void;
|
|
854
|
+
private onSubscriptionChanged;
|
|
855
|
+
private scheduleSubscriptionChange;
|
|
856
|
+
}
|
|
999
857
|
interface SyncSample {
|
|
1000
858
|
type: Type;
|
|
1001
859
|
isSync: boolean;
|
|
@@ -1081,6 +939,143 @@ declare class SyncModule {
|
|
|
1081
939
|
number
|
|
1082
940
|
];
|
|
1083
941
|
}
|
|
942
|
+
declare const defaultOptions: {
|
|
943
|
+
sizeBasedResolutionCapEnabled: boolean;
|
|
944
|
+
pictureInPictureEnabled: boolean;
|
|
945
|
+
abrEnabled: boolean;
|
|
946
|
+
mseEnabled: boolean;
|
|
947
|
+
mseOpusEnabled: boolean;
|
|
948
|
+
muted: boolean;
|
|
949
|
+
minBufferTime: number;
|
|
950
|
+
maxBufferTime: number;
|
|
951
|
+
logLevel: Level;
|
|
952
|
+
maxSize: Size;
|
|
953
|
+
maxVideoBitRate: number;
|
|
954
|
+
maxAudioBitRate: number;
|
|
955
|
+
tags: string[];
|
|
956
|
+
media: Media;
|
|
957
|
+
reconnectHandler: (state: ReconnectState) => Promise<boolean> | boolean;
|
|
958
|
+
advanced: {
|
|
959
|
+
wasmDecodingConstraint: Partial<VideoConstraint>;
|
|
960
|
+
};
|
|
961
|
+
};
|
|
962
|
+
interface UserAgentInformation {
|
|
963
|
+
userAgent: string;
|
|
964
|
+
locationOrigin: string;
|
|
965
|
+
locationPath: string;
|
|
966
|
+
ancestorOrigins?: string[];
|
|
967
|
+
}
|
|
968
|
+
declare type StatisticsType<K> = K extends {
|
|
969
|
+
getStatistics: () => unknown;
|
|
970
|
+
} ? ReturnType<K["getStatistics"]> : never;
|
|
971
|
+
declare type StatisticsTypes = {
|
|
972
|
+
[Property in keyof Modules]: StatisticsType<Modules[Property]>;
|
|
973
|
+
};
|
|
974
|
+
export declare type ModuleStatistics = Flatten<StatisticsTypes>;
|
|
975
|
+
export declare type Statistics = ModuleStatistics & UserAgentInformation & {
|
|
976
|
+
version: string;
|
|
977
|
+
ip?: string;
|
|
978
|
+
url: string;
|
|
979
|
+
sessionId: string;
|
|
980
|
+
uptime: number;
|
|
981
|
+
videoBitRate?: number;
|
|
982
|
+
audioBitRate?: number;
|
|
983
|
+
bytesReceived: number;
|
|
984
|
+
channelId: string;
|
|
985
|
+
channelGroupId?: string;
|
|
986
|
+
timeToFirstFrame?: number;
|
|
987
|
+
};
|
|
988
|
+
export declare class Vindral extends Emitter<PublicVindralEvents> {
|
|
989
|
+
private static INITIAL_MAX_BIT_RATE;
|
|
990
|
+
readonly pictureInPicture: {
|
|
991
|
+
enter: () => Promise<void>;
|
|
992
|
+
exit: () => Promise<void>;
|
|
993
|
+
isActive: () => boolean;
|
|
994
|
+
isSupported: () => boolean;
|
|
995
|
+
};
|
|
996
|
+
private browser;
|
|
997
|
+
private options;
|
|
998
|
+
private element;
|
|
999
|
+
private playbackSource;
|
|
1000
|
+
private emitter;
|
|
1001
|
+
private logger;
|
|
1002
|
+
private modules;
|
|
1003
|
+
private clientIp?;
|
|
1004
|
+
private sessionId;
|
|
1005
|
+
private _channels;
|
|
1006
|
+
private createdAt;
|
|
1007
|
+
private hasCalledConnect;
|
|
1008
|
+
private apiClient;
|
|
1009
|
+
private durationSessions;
|
|
1010
|
+
constructor(options: Options);
|
|
1011
|
+
attach: (container: HTMLElement) => void;
|
|
1012
|
+
set volume(volume: number);
|
|
1013
|
+
get volume(): number;
|
|
1014
|
+
set muted(muted: boolean);
|
|
1015
|
+
get muted(): boolean;
|
|
1016
|
+
get media(): Media;
|
|
1017
|
+
get videoBitRate(): number;
|
|
1018
|
+
get audioBitRate(): number;
|
|
1019
|
+
get connectionState(): Readonly<State>;
|
|
1020
|
+
get playbackState(): Readonly<PlaybackState>;
|
|
1021
|
+
get bufferFullness(): number;
|
|
1022
|
+
get abrEnabled(): boolean;
|
|
1023
|
+
set abrEnabled(enabled: boolean);
|
|
1024
|
+
get serverEdgeTime(): number | undefined;
|
|
1025
|
+
get serverWallclockTime(): number | undefined;
|
|
1026
|
+
get currentTime(): number;
|
|
1027
|
+
get targetBufferTime(): number;
|
|
1028
|
+
set targetBufferTime(bufferTimeMs: number);
|
|
1029
|
+
get playbackLatency(): number | undefined;
|
|
1030
|
+
get playbackWallclockTime(): number | undefined;
|
|
1031
|
+
get channels(): ReadonlyArray<Channel>;
|
|
1032
|
+
get languages(): ReadonlyArray<string>;
|
|
1033
|
+
get language(): string | undefined;
|
|
1034
|
+
set language(language: string | undefined);
|
|
1035
|
+
get channelId(): string;
|
|
1036
|
+
set channelId(channelId: string);
|
|
1037
|
+
get maxSize(): Size;
|
|
1038
|
+
set maxSize(size: Size);
|
|
1039
|
+
get maxBitRate(): number;
|
|
1040
|
+
set maxBitRate(bitRate: number);
|
|
1041
|
+
get maxVideoBitrate(): number;
|
|
1042
|
+
set maxVideoBitrate(bitRate: number);
|
|
1043
|
+
get maxAudioBitrate(): number;
|
|
1044
|
+
set maxAudioBitrate(bitRate: number);
|
|
1045
|
+
get renditionLevels(): ReadonlyArray<RenditionLevel>;
|
|
1046
|
+
get currentRenditionLevel(): Readonly<RenditionLevel> | undefined;
|
|
1047
|
+
get targetRenditionLevel(): Readonly<RenditionLevel> | undefined;
|
|
1048
|
+
get isSwitchingRenditionLevel(): boolean;
|
|
1049
|
+
get videoBufferedRanges(): ReadonlyArray<TimeRange>;
|
|
1050
|
+
get audioBufferedRanges(): ReadonlyArray<TimeRange>;
|
|
1051
|
+
get lastBufferEvent(): Readonly<BufferStateEvent>;
|
|
1052
|
+
get activeRatios(): Map<string, number>;
|
|
1053
|
+
get bufferingRatios(): Map<string, number>;
|
|
1054
|
+
get timeSpentBuffering(): number;
|
|
1055
|
+
get timeActive(): number;
|
|
1056
|
+
getOptions: () => Options & typeof defaultOptions;
|
|
1057
|
+
updateAuthenticationToken: (token: string) => void;
|
|
1058
|
+
connect: () => void;
|
|
1059
|
+
getCastOptions: () => Options;
|
|
1060
|
+
private connectionInfo;
|
|
1061
|
+
private connectHandler;
|
|
1062
|
+
private filterRenditions;
|
|
1063
|
+
private patchSubscription;
|
|
1064
|
+
private isSupportedVideoCodecProfile;
|
|
1065
|
+
private supportedAudioCodecs;
|
|
1066
|
+
private initializeDecodingModule;
|
|
1067
|
+
unload: () => Promise<void>;
|
|
1068
|
+
userInput: () => void;
|
|
1069
|
+
private play;
|
|
1070
|
+
get uptime(): number;
|
|
1071
|
+
getStatistics: () => Statistics;
|
|
1072
|
+
private onBufferEvent;
|
|
1073
|
+
private alignSizeAndBitRate;
|
|
1074
|
+
private get currentSubscription();
|
|
1075
|
+
private get targetSubscription();
|
|
1076
|
+
private timeToFirstFrame;
|
|
1077
|
+
private willUseMediaSource;
|
|
1078
|
+
}
|
|
1084
1079
|
interface TelemetryModuleOptions {
|
|
1085
1080
|
url: string;
|
|
1086
1081
|
interval?: number;
|
|
@@ -1184,7 +1179,6 @@ export interface Modules {
|
|
|
1184
1179
|
qualityOfService: QualityOfServiceModule;
|
|
1185
1180
|
metadata: MetadataModule;
|
|
1186
1181
|
sync: SyncModule;
|
|
1187
|
-
cast: CastModule;
|
|
1188
1182
|
telemetry?: TelemetryModule;
|
|
1189
1183
|
documentState: DocumentStateModule;
|
|
1190
1184
|
incomingData: IncomingDataModule;
|
|
@@ -1235,7 +1229,7 @@ export interface PlaybackSource {
|
|
|
1235
1229
|
}
|
|
1236
1230
|
export interface PublicVindralEvents {
|
|
1237
1231
|
["error"]: Readonly<VindralError>;
|
|
1238
|
-
["needs user input"]:
|
|
1232
|
+
["needs user input"]: NeedsUserInputContext;
|
|
1239
1233
|
["metadata"]: Readonly<Metadata>;
|
|
1240
1234
|
["playback state"]: Readonly<PlaybackState>;
|
|
1241
1235
|
["connection state"]: Readonly<State>;
|
|
@@ -1400,6 +1394,60 @@ export declare class ApiClient {
|
|
|
1400
1394
|
private toChannels;
|
|
1401
1395
|
private toChannel;
|
|
1402
1396
|
}
|
|
1397
|
+
export declare type CastState = "casting" | "not casting";
|
|
1398
|
+
export interface CastSenderEvents {
|
|
1399
|
+
["connected"]: void;
|
|
1400
|
+
["resumed"]: void;
|
|
1401
|
+
["disconnected"]: void;
|
|
1402
|
+
["failed"]: void;
|
|
1403
|
+
["metadata"]: Metadata;
|
|
1404
|
+
["server wallclock time"]: number;
|
|
1405
|
+
}
|
|
1406
|
+
export interface CastConfig {
|
|
1407
|
+
options: Options;
|
|
1408
|
+
background?: string;
|
|
1409
|
+
receiverApplicationId?: string;
|
|
1410
|
+
}
|
|
1411
|
+
export declare type CustomCastMessageType = "stop" | "start" | "updateAuthToken" | "serverWallclockTime" | "metadata" | "setChannelId" | "setLanguage";
|
|
1412
|
+
export interface CastCustomMessage {
|
|
1413
|
+
type: CustomCastMessageType;
|
|
1414
|
+
channelId?: string;
|
|
1415
|
+
language?: string;
|
|
1416
|
+
config?: CastConfig;
|
|
1417
|
+
token?: string;
|
|
1418
|
+
serverWallclockTime?: number;
|
|
1419
|
+
metadata?: Metadata;
|
|
1420
|
+
}
|
|
1421
|
+
export declare class CastSender extends Emitter<CastSenderEvents> {
|
|
1422
|
+
private state;
|
|
1423
|
+
private config;
|
|
1424
|
+
private unloaded;
|
|
1425
|
+
constructor(config: CastConfig);
|
|
1426
|
+
get casting(): boolean;
|
|
1427
|
+
get volume(): number;
|
|
1428
|
+
set volume(volume: number);
|
|
1429
|
+
get language(): string | undefined;
|
|
1430
|
+
set language(language: string | undefined);
|
|
1431
|
+
get channelId(): string;
|
|
1432
|
+
set channelId(channelId: string);
|
|
1433
|
+
updateAuthenticationToken: (token: string) => void;
|
|
1434
|
+
unload: () => void;
|
|
1435
|
+
init: () => Promise<void>;
|
|
1436
|
+
start: () => Promise<void>;
|
|
1437
|
+
stop: () => void;
|
|
1438
|
+
private onGCastApiAvailable;
|
|
1439
|
+
private send;
|
|
1440
|
+
private onMessage;
|
|
1441
|
+
private onSessionStarted;
|
|
1442
|
+
private onSessionStateChanged;
|
|
1443
|
+
private getInstance;
|
|
1444
|
+
private getSession;
|
|
1445
|
+
private getReceiverName;
|
|
1446
|
+
private castLibrariesAdded;
|
|
1447
|
+
private verifyCastLibraries;
|
|
1448
|
+
}
|
|
1449
|
+
export declare const isValidOptions: (options: unknown) => options is Options;
|
|
1450
|
+
export declare const validateOptions: (options: Options) => Options;
|
|
1403
1451
|
interface FullscreenEvents {
|
|
1404
1452
|
["on fullscreen change"]: boolean;
|
|
1405
1453
|
}
|
|
@@ -1417,6 +1465,7 @@ declare class Fullscreen extends Emitter<FullscreenEvents> {
|
|
|
1417
1465
|
}
|
|
1418
1466
|
export interface PlayerOptions {
|
|
1419
1467
|
controlsEnabled?: boolean;
|
|
1468
|
+
castEnabled?: boolean;
|
|
1420
1469
|
fullscreenButtonEnabled?: boolean;
|
|
1421
1470
|
pipButtonEnabled?: boolean;
|
|
1422
1471
|
channelSelectionEnabled?: boolean;
|
|
@@ -1424,6 +1473,8 @@ export interface PlayerOptions {
|
|
|
1424
1473
|
languagesButtonEnabled?: boolean;
|
|
1425
1474
|
oneToOneButtonEnabled?: boolean;
|
|
1426
1475
|
hideTimeout?: number;
|
|
1476
|
+
castBackground?: string;
|
|
1477
|
+
castReceiverApplicationId?: string;
|
|
1427
1478
|
}
|
|
1428
1479
|
export interface PlayerState {
|
|
1429
1480
|
isBuffering: boolean;
|
|
@@ -1432,16 +1483,19 @@ export interface PlayerState {
|
|
|
1432
1483
|
}
|
|
1433
1484
|
export declare class Player {
|
|
1434
1485
|
readonly core: Vindral;
|
|
1486
|
+
readonly castSender: CastSender;
|
|
1435
1487
|
private options;
|
|
1436
1488
|
private state;
|
|
1437
1489
|
private playerElement;
|
|
1438
1490
|
private bufferingOverlay;
|
|
1491
|
+
private playOverlay;
|
|
1439
1492
|
private bar;
|
|
1440
1493
|
private stateInterval?;
|
|
1441
1494
|
private showBufferingTimeout?;
|
|
1442
1495
|
constructor(optionsOrInstance: Options | Vindral, playerOptions?: PlayerOptions);
|
|
1443
1496
|
unload: () => void;
|
|
1444
1497
|
attach: (container: HTMLElement) => void;
|
|
1498
|
+
private setupCastSender;
|
|
1445
1499
|
private onMouseMove;
|
|
1446
1500
|
private onClick;
|
|
1447
1501
|
private togglePip;
|
package/package.json
CHANGED