@cloudflare/realtimekit 2.1.1-staging.1 → 2.2.0-staging.2

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.
@@ -3130,7 +3130,8 @@ declare class Internals {
3130
3130
  features: Features;
3131
3131
  browserSpecs: BrowserCapabilities;
3132
3132
  callStats: InhouseCallStats;
3133
- constructor(authToken: string, logger: Logger, features: Features, callStats: InhouseCallStats);
3133
+ constructor(context: Context<ContextState>);
3134
+ setUiKitMetadata(metadata: UiKitMetadata): void;
3134
3135
  static init(context: Context<ContextState>): Internals;
3135
3136
  }
3136
3137
  type LivestreamState = 'IDLE' | 'STARTING' | 'WAITING_ON_MANUAL_INGESTION' | 'LIVESTREAMING' | 'STOPPING';
@@ -3513,6 +3514,43 @@ declare class Client {
3513
3514
  readonly audio: AudioPlaybackManager;
3514
3515
  readonly __internals__: Readonly<Internals>;
3515
3516
  }
3517
+ declare const VideoCodecToMimeTypeMap: {
3518
+ readonly VP8: "video/VP8";
3519
+ readonly VP9: "video/VP9";
3520
+ readonly H264: "video/H264";
3521
+ readonly H265: "video/H265";
3522
+ readonly AV1: "video/AV1";
3523
+ };
3524
+ type VideoCodecs = keyof typeof VideoCodecToMimeTypeMap;
3525
+ type VideoCodecMimeType = typeof VideoCodecToMimeTypeMap[VideoCodecs];
3526
+ declare const AudioCodecToMimeTypeMap: {
3527
+ readonly OPUS: "audio/opus";
3528
+ readonly PCMA: "audio/PCMA";
3529
+ readonly PCMU: "audio/PCMU";
3530
+ };
3531
+ type AudioCodecs = keyof typeof AudioCodecToMimeTypeMap;
3532
+ type AudioCodecMimeType = typeof AudioCodecToMimeTypeMap[AudioCodecs];
3533
+ type CodecMimeType = VideoCodecMimeType | AudioCodecMimeType;
3534
+ interface MediaProducerConfiguration {
3535
+ video?: {
3536
+ codec?: VideoCodecs;
3537
+ };
3538
+ audio?: {
3539
+ codec?: AudioCodecs;
3540
+ };
3541
+ screenshareVideo?: {
3542
+ codec?: VideoCodecs;
3543
+ };
3544
+ screenshareAudio?: {
3545
+ codec?: AudioCodecs;
3546
+ };
3547
+ }
3548
+ interface MediaProducerCodecs {
3549
+ video: VideoCodecMimeType;
3550
+ audio: AudioCodecMimeType;
3551
+ screenshareVideo: VideoCodecMimeType;
3552
+ screenshareAudio: AudioCodecMimeType;
3553
+ }
3516
3554
  type ClientType = {
3517
3555
  callStats?: unknown;
3518
3556
  Telemetry?: typeof Telemetry;
@@ -3547,7 +3585,7 @@ type HandlerRunOptions = {
3547
3585
  onTrackHandler?: (event: RTCTrackEvent) => void;
3548
3586
  };
3549
3587
  type CodecOption = {
3550
- name: string;
3588
+ mimeType: CodecMimeType;
3551
3589
  parameters?: string[];
3552
3590
  };
3553
3591
  type HandlerSendOptions = {
@@ -4162,6 +4200,7 @@ interface DefaultOptions {
4162
4200
  audio?: AudioQualityConstraints;
4163
4201
  screenshare?: ScreenshareQualityConstraints;
4164
4202
  };
4203
+ mediaProducerConfiguration?: MediaProducerConfiguration;
4165
4204
  isNonPreferredDevice?: (device: MediaDeviceInfo) => boolean;
4166
4205
  plugins?: ClientPluginConfig[];
4167
4206
  viewMode?: ViewMode;
@@ -4219,6 +4258,7 @@ type ContextState = {
4219
4258
  presetName?: string;
4220
4259
  maxPreferredStreams?: number;
4221
4260
  defaults?: DefaultOptions;
4261
+ mediaProducerCodecs?: MediaProducerCodecs;
4222
4262
  modules?: Modules;
4223
4263
  overrides?: Overrides;
4224
4264
  apiClient?: APIClient;
@@ -4379,6 +4419,7 @@ interface ProducerState {
4379
4419
  producingPeerId: string;
4380
4420
  mimeType?: string;
4381
4421
  consumer?: Partial<Consumer>;
4422
+ appData?: string;
4382
4423
  }
4383
4424
  interface IParticipant {
4384
4425
  id: string;
@@ -4710,6 +4751,10 @@ type LogLevel = readonly [
4710
4751
  ];
4711
4752
  type EventSeverities = SupportedEventSeverities;
4712
4753
  type LogData$1 = LogData$2;
4754
+ interface UiKitMetadata {
4755
+ sdkVersion: string;
4756
+ sdkName: 'angular' | 'html' | 'react' | 'react-native' | 'unknown';
4757
+ }
4713
4758
  interface MeetingMetadata {
4714
4759
  peerId?: string;
4715
4760
  roomName?: string;
@@ -4718,6 +4763,10 @@ interface MeetingMetadata {
4718
4763
  deviceInfo?: object;
4719
4764
  visitedUrl?: string;
4720
4765
  userId?: string;
4766
+ uikit?: {
4767
+ sdkName: UiKitMetadata['sdkName'];
4768
+ sdkVersion: UiKitMetadata['sdkVersion'];
4769
+ };
4721
4770
  }
4722
4771
  declare class Telemetry {
4723
4772
  logsCache: {
@@ -4735,6 +4784,7 @@ declare class Telemetry {
4735
4784
  logExclusionList: string[];
4736
4785
  meetingMetadata: MeetingMetadata;
4737
4786
  resetPeerId(peerId: string): void;
4787
+ setUiKitMetadata({ sdkVersion, sdkName }: UiKitMetadata): void;
4738
4788
  init(context: Context<ContextState>, options: MeetingMetadata, enableTracing: boolean, logLevel: LogLevel[number]): void;
4739
4789
  static trace(spanName: string, metadata?: LogData$1 | undefined): (_target: Object, _propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
4740
4790
  injectContext(injectionReceiver: any): void;
@@ -2222,6 +2222,43 @@ declare class ClientMap<T extends (EventMap$1 & WildCardEvent<T>), U extends {
2222
2222
  clear(emitEvent?: boolean, removeListeners?: boolean): void;
2223
2223
  toArray(): U[];
2224
2224
  }
2225
+ declare const VideoCodecToMimeTypeMap: {
2226
+ readonly VP8: "video/VP8";
2227
+ readonly VP9: "video/VP9";
2228
+ readonly H264: "video/H264";
2229
+ readonly H265: "video/H265";
2230
+ readonly AV1: "video/AV1";
2231
+ };
2232
+ type VideoCodecs = keyof typeof VideoCodecToMimeTypeMap;
2233
+ type VideoCodecMimeType = typeof VideoCodecToMimeTypeMap[VideoCodecs];
2234
+ declare const AudioCodecToMimeTypeMap: {
2235
+ readonly OPUS: "audio/opus";
2236
+ readonly PCMA: "audio/PCMA";
2237
+ readonly PCMU: "audio/PCMU";
2238
+ };
2239
+ type AudioCodecs = keyof typeof AudioCodecToMimeTypeMap;
2240
+ type AudioCodecMimeType = typeof AudioCodecToMimeTypeMap[AudioCodecs];
2241
+ type CodecMimeType = VideoCodecMimeType | AudioCodecMimeType;
2242
+ interface MediaProducerConfiguration {
2243
+ video?: {
2244
+ codec?: VideoCodecs;
2245
+ };
2246
+ audio?: {
2247
+ codec?: AudioCodecs;
2248
+ };
2249
+ screenshareVideo?: {
2250
+ codec?: VideoCodecs;
2251
+ };
2252
+ screenshareAudio?: {
2253
+ codec?: AudioCodecs;
2254
+ };
2255
+ }
2256
+ interface MediaProducerCodecs {
2257
+ video: VideoCodecMimeType;
2258
+ audio: AudioCodecMimeType;
2259
+ screenshareVideo: VideoCodecMimeType;
2260
+ screenshareAudio: AudioCodecMimeType;
2261
+ }
2225
2262
  interface GenericHandlerResult {
2226
2263
  offerSdp: RTCSessionDescriptionInit;
2227
2264
  callback: (answer: RTCSessionDescriptionInit) => Promise<any>;
@@ -2236,7 +2273,7 @@ type HandlerRunOptions = {
2236
2273
  onTrackHandler?: (event: RTCTrackEvent) => void;
2237
2274
  };
2238
2275
  type CodecOption = {
2239
- name: string;
2276
+ mimeType: CodecMimeType;
2240
2277
  parameters?: string[];
2241
2278
  };
2242
2279
  type HandlerSendOptions = {
@@ -3762,7 +3799,8 @@ declare class Internals {
3762
3799
  features: Features;
3763
3800
  browserSpecs: BrowserCapabilities;
3764
3801
  callStats: InhouseCallStats;
3765
- constructor(authToken: string, logger: Logger, features: Features, callStats: InhouseCallStats);
3802
+ constructor(context: Context<ContextState>);
3803
+ setUiKitMetadata(metadata: UiKitMetadata): void;
3766
3804
  static init(context: Context<ContextState>): Internals;
3767
3805
  }
3768
3806
  declare const enum PRODUCERS_TYPE {
@@ -3994,6 +4032,7 @@ interface DefaultOptions {
3994
4032
  audio?: AudioQualityConstraints;
3995
4033
  screenshare?: ScreenshareQualityConstraints;
3996
4034
  };
4035
+ mediaProducerConfiguration?: MediaProducerConfiguration;
3997
4036
  isNonPreferredDevice?: (device: MediaDeviceInfo) => boolean;
3998
4037
  plugins?: ClientPluginConfig[];
3999
4038
  viewMode?: ViewMode;
@@ -4164,6 +4203,7 @@ type ContextState = {
4164
4203
  presetName?: string;
4165
4204
  maxPreferredStreams?: number;
4166
4205
  defaults?: DefaultOptions;
4206
+ mediaProducerCodecs?: MediaProducerCodecs;
4167
4207
  modules?: Modules;
4168
4208
  overrides?: Overrides;
4169
4209
  apiClient?: APIClient;
@@ -4324,6 +4364,7 @@ interface ProducerState {
4324
4364
  producingPeerId: string;
4325
4365
  mimeType?: string;
4326
4366
  consumer?: Partial<Consumer>;
4367
+ appData?: string;
4327
4368
  }
4328
4369
  interface IParticipant {
4329
4370
  id: string;
@@ -4655,6 +4696,10 @@ type LogLevel = readonly [
4655
4696
  ];
4656
4697
  type EventSeverities = SupportedEventSeverities;
4657
4698
  type LogData$1 = LogData$2;
4699
+ interface UiKitMetadata {
4700
+ sdkVersion: string;
4701
+ sdkName: 'angular' | 'html' | 'react' | 'react-native' | 'unknown';
4702
+ }
4658
4703
  interface MeetingMetadata {
4659
4704
  peerId?: string;
4660
4705
  roomName?: string;
@@ -4663,6 +4708,10 @@ interface MeetingMetadata {
4663
4708
  deviceInfo?: object;
4664
4709
  visitedUrl?: string;
4665
4710
  userId?: string;
4711
+ uikit?: {
4712
+ sdkName: UiKitMetadata['sdkName'];
4713
+ sdkVersion: UiKitMetadata['sdkVersion'];
4714
+ };
4666
4715
  }
4667
4716
  declare class Telemetry {
4668
4717
  logsCache: {
@@ -4680,6 +4729,7 @@ declare class Telemetry {
4680
4729
  logExclusionList: string[];
4681
4730
  meetingMetadata: MeetingMetadata;
4682
4731
  resetPeerId(peerId: string): void;
4732
+ setUiKitMetadata({ sdkVersion, sdkName }: UiKitMetadata): void;
4683
4733
  init(context: Context<ContextState>, options: MeetingMetadata, enableTracing: boolean, logLevel: LogLevel[number]): void;
4684
4734
  static trace(spanName: string, metadata?: LogData$1 | undefined): (_target: Object, _propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
4685
4735
  injectContext(injectionReceiver: any): void;
@@ -4831,4 +4881,4 @@ declare global {
4831
4881
  TransformStream?: any;
4832
4882
  }
4833
4883
  }
4834
- export { ActiveTab, ActiveTabType, AudioMiddleware, BroadcastMessagePayload, CachedUserDetails, ChatUpdateParams, ClientError, ClientPluginConfig, ClientPluginPermissions, CustomMessage, DeviceConfig, FileMessage, ImageMessage, JoinedPeer, LeaveRoomState, LivestreamIngestionCredentials, LivestreamState, LogData, MediaConnectionState, MediaConnectionUpdate, MediaConstraints, MediaKind, MediaPermission, Message, BasicParticipant as RTKBasicParticipant, BasicParticipantsMap as RTKBasicParticipantsMap, RTKChat, ClientOptions as RTKClientOptions, RTKConfigOptions, RTKConnectedMeetings, RTKLivestream, RTKLogger, RTKMeta, RTKParticipant, RTKParticipantMap, RTKParticipants, RTKPermissionsPreset, RTKPlugin, RTKPluginMap, RTKPlugins, RTKPolls, RTKRecording, RTKSelf, RTKSelfMedia, RTKStore, StoreData as RTKStoreData, RateLimitConfig as RTKStoreRateLimitConfig, RTKThemePreset, RecordingState, RequestToJoinType, SocketConnectionState, StageStatus, StartLivestreamConfig, TextMessage, UserDetailsResponseV2, VideoMiddleware, VideoQualityConstraints, Client as default, LeaveRoomState as leaveRoomState };
4884
+ export { ActiveTab, ActiveTabType, AudioCodecMimeType, AudioCodecs, AudioMiddleware, BroadcastMessagePayload, CachedUserDetails, ChatUpdateParams, ClientError, ClientPluginConfig, ClientPluginPermissions, CodecMimeType, CustomMessage, DeviceConfig, FileMessage, ImageMessage, JoinedPeer, LeaveRoomState, LivestreamIngestionCredentials, LivestreamState, LogData, MediaConnectionState, MediaConnectionUpdate, MediaConstraints, MediaKind, MediaPermission, MediaProducerConfiguration, Message, BasicParticipant as RTKBasicParticipant, BasicParticipantsMap as RTKBasicParticipantsMap, RTKChat, ClientOptions as RTKClientOptions, RTKConfigOptions, RTKConnectedMeetings, RTKLivestream, RTKLogger, RTKMeta, RTKParticipant, RTKParticipantMap, RTKParticipants, RTKPermissionsPreset, RTKPlugin, RTKPluginMap, RTKPlugins, RTKPolls, RTKRecording, RTKSelf, RTKSelfMedia, RTKStore, StoreData as RTKStoreData, RateLimitConfig as RTKStoreRateLimitConfig, RTKThemePreset, RecordingState, RequestToJoinType, SocketConnectionState, StageStatus, StartLivestreamConfig, TextMessage, UserDetailsResponseV2, VideoCodecMimeType, VideoCodecs, VideoMiddleware, VideoQualityConstraints, Client as default, LeaveRoomState as leaveRoomState };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudflare/realtimekit",
3
- "version": "2.1.1-staging.1",
3
+ "version": "2.2.0-staging.2",
4
4
  "description": "A real-time video and audio SDK for building custom, collaborative communication experiences.",
5
5
  "license": "Apache-2.0",
6
6
  "files": [