@vindral/web-sdk 2.0.3 → 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 -192
- 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,191 +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
|
-
get playbackLatency(): number | undefined;
|
|
582
|
-
get playbackWallclockTime(): number | undefined;
|
|
583
|
-
get channels(): ReadonlyArray<Channel>;
|
|
584
|
-
get languages(): ReadonlyArray<string>;
|
|
585
|
-
get language(): string | undefined;
|
|
586
|
-
set language(language: string | undefined);
|
|
587
|
-
get channelId(): string;
|
|
588
|
-
set channelId(channelId: string);
|
|
589
|
-
get maxSize(): Size;
|
|
590
|
-
set maxSize(size: Size);
|
|
591
|
-
get maxBitRate(): number;
|
|
592
|
-
set maxBitRate(bitRate: number);
|
|
593
|
-
get maxVideoBitrate(): number;
|
|
594
|
-
set maxVideoBitrate(bitRate: number);
|
|
595
|
-
get maxAudioBitrate(): number;
|
|
596
|
-
set maxAudioBitrate(bitRate: number);
|
|
597
|
-
get renditionLevels(): ReadonlyArray<RenditionLevel>;
|
|
598
|
-
get currentRenditionLevel(): Readonly<RenditionLevel> | undefined;
|
|
599
|
-
get targetRenditionLevel(): Readonly<RenditionLevel> | undefined;
|
|
600
|
-
get isSwitchingRenditionLevel(): boolean;
|
|
601
|
-
get videoBufferedRanges(): ReadonlyArray<TimeRange>;
|
|
602
|
-
get audioBufferedRanges(): ReadonlyArray<TimeRange>;
|
|
603
|
-
get lastBufferEvent(): Readonly<BufferStateEvent>;
|
|
604
|
-
get activeRatios(): Map<string, number>;
|
|
605
|
-
get bufferingRatios(): Map<string, number>;
|
|
606
|
-
get timeSpentBuffering(): number;
|
|
607
|
-
get timeActive(): number;
|
|
608
|
-
updateAuthenticationToken: (token: string) => void;
|
|
609
|
-
connect: () => void;
|
|
610
|
-
private connectionInfo;
|
|
611
|
-
private connectHandler;
|
|
612
|
-
private filterRenditions;
|
|
613
|
-
private patchSubscription;
|
|
614
|
-
private isSupportedVideoCodecProfile;
|
|
615
|
-
private supportedAudioCodecs;
|
|
616
|
-
private initializeDecodingModule;
|
|
617
|
-
unload: () => Promise<void>;
|
|
618
|
-
userInput: () => void;
|
|
619
|
-
private play;
|
|
620
|
-
get uptime(): number;
|
|
621
|
-
getStatistics: () => Statistics;
|
|
622
|
-
private onBufferEvent;
|
|
623
|
-
private alignSizeAndBitRate;
|
|
624
|
-
private get currentSubscription();
|
|
625
|
-
private get targetSubscription();
|
|
626
|
-
private timeToFirstFrame;
|
|
627
|
-
private willUseMediaSource;
|
|
628
|
-
}
|
|
629
|
-
interface CastModuleListeners {
|
|
630
|
-
["cast"]: void;
|
|
631
|
-
}
|
|
632
|
-
interface CastModuleEvents {
|
|
633
|
-
["cast started"]: void;
|
|
634
|
-
["cast resumed"]: void;
|
|
635
|
-
["cast stopped"]: void;
|
|
636
|
-
["cast failed"]: void;
|
|
637
|
-
}
|
|
638
|
-
interface CastConfig {
|
|
639
|
-
options: Options;
|
|
640
|
-
background?: string;
|
|
641
|
-
receiverApplicationId?: string;
|
|
642
|
-
}
|
|
643
|
-
declare class CastModule {
|
|
644
|
-
private emitter;
|
|
645
|
-
private logger;
|
|
646
|
-
private state;
|
|
647
|
-
get volume(): number;
|
|
648
|
-
set volume(volume: number);
|
|
649
|
-
constructor(emitter: Emitter<CastModuleListeners, CastModuleEvents>, logger: Logger);
|
|
650
|
-
static create: (emitter: Emitter<CastModuleListeners, CastModuleEvents>, logger: Logger) => CastModule;
|
|
651
|
-
unload: () => void;
|
|
652
|
-
start: (config: CastConfig) => Promise<void>;
|
|
653
|
-
stop: () => void;
|
|
654
|
-
private onGCastApiAvailable;
|
|
655
|
-
private onSessionStateChanged;
|
|
656
|
-
private getInstance;
|
|
657
|
-
}
|
|
658
|
-
interface Size {
|
|
659
|
-
width: number;
|
|
660
|
-
height: number;
|
|
661
|
-
}
|
|
662
|
-
interface PictureInPictureSizeSource {
|
|
663
|
-
getPictureInPictureSize(): Size | undefined;
|
|
664
|
-
}
|
|
665
491
|
declare type DeepPartial<T> = {
|
|
666
492
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
667
493
|
};
|
|
@@ -995,6 +821,39 @@ declare class QualityOfServiceModule {
|
|
|
995
821
|
private setActive;
|
|
996
822
|
private unsetActive;
|
|
997
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
|
+
}
|
|
998
857
|
interface SyncSample {
|
|
999
858
|
type: Type;
|
|
1000
859
|
isSync: boolean;
|
|
@@ -1080,6 +939,143 @@ declare class SyncModule {
|
|
|
1080
939
|
number
|
|
1081
940
|
];
|
|
1082
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
|
+
}
|
|
1083
1079
|
interface TelemetryModuleOptions {
|
|
1084
1080
|
url: string;
|
|
1085
1081
|
interval?: number;
|
|
@@ -1183,7 +1179,6 @@ export interface Modules {
|
|
|
1183
1179
|
qualityOfService: QualityOfServiceModule;
|
|
1184
1180
|
metadata: MetadataModule;
|
|
1185
1181
|
sync: SyncModule;
|
|
1186
|
-
cast: CastModule;
|
|
1187
1182
|
telemetry?: TelemetryModule;
|
|
1188
1183
|
documentState: DocumentStateModule;
|
|
1189
1184
|
incomingData: IncomingDataModule;
|
|
@@ -1234,7 +1229,7 @@ export interface PlaybackSource {
|
|
|
1234
1229
|
}
|
|
1235
1230
|
export interface PublicVindralEvents {
|
|
1236
1231
|
["error"]: Readonly<VindralError>;
|
|
1237
|
-
["needs user input"]:
|
|
1232
|
+
["needs user input"]: NeedsUserInputContext;
|
|
1238
1233
|
["metadata"]: Readonly<Metadata>;
|
|
1239
1234
|
["playback state"]: Readonly<PlaybackState>;
|
|
1240
1235
|
["connection state"]: Readonly<State>;
|
|
@@ -1399,6 +1394,60 @@ export declare class ApiClient {
|
|
|
1399
1394
|
private toChannels;
|
|
1400
1395
|
private toChannel;
|
|
1401
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;
|
|
1402
1451
|
interface FullscreenEvents {
|
|
1403
1452
|
["on fullscreen change"]: boolean;
|
|
1404
1453
|
}
|
|
@@ -1416,6 +1465,7 @@ declare class Fullscreen extends Emitter<FullscreenEvents> {
|
|
|
1416
1465
|
}
|
|
1417
1466
|
export interface PlayerOptions {
|
|
1418
1467
|
controlsEnabled?: boolean;
|
|
1468
|
+
castEnabled?: boolean;
|
|
1419
1469
|
fullscreenButtonEnabled?: boolean;
|
|
1420
1470
|
pipButtonEnabled?: boolean;
|
|
1421
1471
|
channelSelectionEnabled?: boolean;
|
|
@@ -1423,6 +1473,8 @@ export interface PlayerOptions {
|
|
|
1423
1473
|
languagesButtonEnabled?: boolean;
|
|
1424
1474
|
oneToOneButtonEnabled?: boolean;
|
|
1425
1475
|
hideTimeout?: number;
|
|
1476
|
+
castBackground?: string;
|
|
1477
|
+
castReceiverApplicationId?: string;
|
|
1426
1478
|
}
|
|
1427
1479
|
export interface PlayerState {
|
|
1428
1480
|
isBuffering: boolean;
|
|
@@ -1431,16 +1483,19 @@ export interface PlayerState {
|
|
|
1431
1483
|
}
|
|
1432
1484
|
export declare class Player {
|
|
1433
1485
|
readonly core: Vindral;
|
|
1486
|
+
readonly castSender: CastSender;
|
|
1434
1487
|
private options;
|
|
1435
1488
|
private state;
|
|
1436
1489
|
private playerElement;
|
|
1437
1490
|
private bufferingOverlay;
|
|
1491
|
+
private playOverlay;
|
|
1438
1492
|
private bar;
|
|
1439
1493
|
private stateInterval?;
|
|
1440
1494
|
private showBufferingTimeout?;
|
|
1441
1495
|
constructor(optionsOrInstance: Options | Vindral, playerOptions?: PlayerOptions);
|
|
1442
1496
|
unload: () => void;
|
|
1443
1497
|
attach: (container: HTMLElement) => void;
|
|
1498
|
+
private setupCastSender;
|
|
1444
1499
|
private onMouseMove;
|
|
1445
1500
|
private onClick;
|
|
1446
1501
|
private togglePip;
|
package/package.json
CHANGED