-
Notifications
You must be signed in to change notification settings - Fork 223
Expand file tree
/
Copy pathAgoraBase.ts
More file actions
5508 lines (5323 loc) · 166 KB
/
AgoraBase.ts
File metadata and controls
5508 lines (5323 loc) · 166 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import './extension/AgoraBaseExtension';
import {
AudioSourceType,
RenderModeType,
VideoModulePosition,
VideoSourceType,
} from './AgoraMediaBase';
/**
* The channel profile.
*/
export enum ChannelProfileType {
/**
* 0: Communication. Use this profile when there are only two users in the channel.
*/
ChannelProfileCommunication = 0,
/**
* 1: Live streaming. Live streaming. Use this profile when there are more than two users in the channel.
*/
ChannelProfileLiveBroadcasting = 1,
/**
* 2: Gaming. This profile is deprecated.
*/
ChannelProfileGame = 2,
/**
* Cloud gaming. The scenario is optimized for latency. Use this profile if the use case requires frequent interactions between users.
*/
ChannelProfileCloudGaming = 3,
/**
* @ignore
*/
ChannelProfileCommunication1v1 = 4,
}
/**
* @ignore
*/
export enum WarnCodeType {
/**
* @ignore
*/
WarnInvalidView = 8,
/**
* @ignore
*/
WarnInitVideo = 16,
/**
* @ignore
*/
WarnPending = 20,
/**
* @ignore
*/
WarnNoAvailableChannel = 103,
/**
* @ignore
*/
WarnLookupChannelTimeout = 104,
/**
* @ignore
*/
WarnLookupChannelRejected = 105,
/**
* @ignore
*/
WarnOpenChannelTimeout = 106,
/**
* @ignore
*/
WarnOpenChannelRejected = 107,
/**
* @ignore
*/
WarnSwitchLiveVideoTimeout = 111,
/**
* @ignore
*/
WarnSetClientRoleTimeout = 118,
/**
* @ignore
*/
WarnOpenChannelInvalidTicket = 121,
/**
* @ignore
*/
WarnOpenChannelTryNextVos = 122,
/**
* @ignore
*/
WarnChannelConnectionUnrecoverable = 131,
/**
* @ignore
*/
WarnChannelConnectionIpChanged = 132,
/**
* @ignore
*/
WarnChannelConnectionPortChanged = 133,
/**
* @ignore
*/
WarnChannelSocketError = 134,
/**
* @ignore
*/
WarnAudioMixingOpenError = 701,
/**
* @ignore
*/
WarnAdmRuntimePlayoutWarning = 1014,
/**
* @ignore
*/
WarnAdmRuntimeRecordingWarning = 1016,
/**
* @ignore
*/
WarnAdmRecordAudioSilence = 1019,
/**
* @ignore
*/
WarnAdmPlayoutMalfunction = 1020,
/**
* @ignore
*/
WarnAdmRecordMalfunction = 1021,
/**
* @ignore
*/
WarnAdmRecordAudioLowlevel = 1031,
/**
* @ignore
*/
WarnAdmPlayoutAudioLowlevel = 1032,
/**
* @ignore
*/
WarnAdmWindowsNoDataReadyEvent = 1040,
/**
* @ignore
*/
WarnApmHowling = 1051,
/**
* @ignore
*/
WarnAdmGlitchState = 1052,
/**
* @ignore
*/
WarnAdmImproperSettings = 1053,
/**
* @ignore
*/
WarnAdmPopState = 1055,
/**
* @ignore
*/
WarnAdmWinCoreNoRecordingDevice = 1322,
/**
* @ignore
*/
WarnAdmWinCoreNoPlayoutDevice = 1323,
/**
* @ignore
*/
WarnAdmWinCoreImproperCaptureRelease = 1324,
}
/**
* Error codes.
*
* An error code indicates that the SDK encountered an unrecoverable error that requires application intervention. For example, an error is returned when the camera fails to open, and the app needs to inform the user that the camera cannot be used.
*/
export enum ErrorCodeType {
/**
* 0: No error.
*/
ErrOk = 0,
/**
* 1: General error with no classified reason. Try calling the method again.
*/
ErrFailed = 1,
/**
* 2: An invalid parameter is used. For example, the specified channel name includes illegal characters. Reset the parameter.
*/
ErrInvalidArgument = 2,
/**
* 3: The SDK is not ready. Possible reasons include the following:
* The initialization of IRtcEngine fails. Reinitialize the IRtcEngine.
* No user has joined the channel when the method is called. Check the code logic.
* The user has not left the channel when the rate or complain method is called. Check the code logic.
* The audio module is disabled.
* The program is not complete.
*/
ErrNotReady = 3,
/**
* 4: The IRtcEngine does not support the request. Possible reasons include the following:
* The built-in encryption mode is incorrect, or the SDK fails to load the external encryption library. Check the encryption mode setting, or reload the external encryption library.
*/
ErrNotSupported = 4,
/**
* 5: The request is rejected. Possible reasons include the following:
* The IRtcEngine initialization fails. Reinitialize the IRtcEngine.
* The channel name is set as the empty string "" when joining the channel. Reset the channel name.
* When the joinChannelEx method is called to join multiple channels, the specified channel name is already in use. Reset the channel name.
*/
ErrRefused = 5,
/**
* 6: The buffer size is insufficient to store the returned data.
*/
ErrBufferTooSmall = 6,
/**
* 7: A method is called before the initialization of IRtcEngine. Ensure that the IRtcEngine object is initialized before using this method.
*/
ErrNotInitialized = 7,
/**
* 8: Invalid state.
*/
ErrInvalidState = 8,
/**
* 9: Permission to access is not granted. Check whether your app has access to the audio and video device.
*/
ErrNoPermission = 9,
/**
* 10: A timeout occurs. Some API calls require the SDK to return the execution result. This error occurs if the SDK takes too long (more than 10 seconds) to return the result.
*/
ErrTimedout = 10,
/**
* @ignore
*/
ErrCanceled = 11,
/**
* @ignore
*/
ErrTooOften = 12,
/**
* @ignore
*/
ErrBindSocket = 13,
/**
* @ignore
*/
ErrNetDown = 14,
/**
* 17: The request to join the channel is rejected. Possible reasons include the following:
* The user is already in the channel. Agora recommends that you use the onConnectionStateChanged callback to see whether the user is in the channel. Do not call this method to join the channel unless you receive the ConnectionStateDisconnected (1) state.
* After calling startEchoTest for the call test, the user tries to join the channel without calling stopEchoTest to end the current test. To join a channel, the call test must be ended by calling stopEchoTest.
*/
ErrJoinChannelRejected = 17,
/**
* 18: Fails to leave the channel. Possible reasons include the following:
* The user has left the channel before calling the leaveChannel method. Stop calling this method to clear this error.
* The user calls the leaveChannel method to leave the channel before joining the channel. In this case, no extra operation is needed.
*/
ErrLeaveChannelRejected = 18,
/**
* 19: Resources are already in use.
*/
ErrAlreadyInUse = 19,
/**
* 20: The request is abandoned by the SDK, possibly because the request has been sent too frequently.
*/
ErrAborted = 20,
/**
* 21: The IRtcEngine fails to initialize and has crashed because of specific Windows firewall settings.
*/
ErrInitNetEngine = 21,
/**
* 22: The SDK fails to allocate resources because your app uses too many system resources or system resources are insufficient.
*/
ErrResourceLimited = 22,
/**
* 101: The specified App ID is invalid. Rejoin the channel with a valid App ID.
*/
ErrInvalidAppId = 101,
/**
* 102: The specified channel name is invalid. A possible reason is that the parameter's data type is incorrect. Rejoin the channel with a valid channel name.
*/
ErrInvalidChannelName = 102,
/**
* 103: Fails to get server resources in the specified region. Try another region when initializing IRtcEngine.
*/
ErrNoServerResources = 103,
/**
* 109: The current token has expired. Apply for a new token on the server and call renewToken. Deprecated: This enumerator is deprecated. Use ConnectionChangedTokenExpired (9) in the onConnectionStateChanged callback instead.
*/
ErrTokenExpired = 109,
/**
* 110: Invalid token. Typical reasons include the following:
* App Certificate is enabled in Agora Console, but the code still uses App ID for authentication. Once App Certificate is enabled for a project, you must use token-based authentication.
* The uid used to generate the token is not the same as the uid used to join the channel. Deprecated: This enumerator is deprecated. Use ConnectionChangedInvalidToken (8) in the onConnectionStateChanged callback instead.
*/
ErrInvalidToken = 110,
/**
* 111: The network connection is interrupted. The SDK triggers this callback when it loses connection with the server for more than four seconds after the connection is established.
*/
ErrConnectionInterrupted = 111,
/**
* 112: The network connection is lost. Occurs when the SDK cannot reconnect to Agora's edge server 10 seconds after its connection to the server is interrupted.
*/
ErrConnectionLost = 112,
/**
* 113: The user is not in the channel when calling the sendStreamMessage method.
*/
ErrNotInChannel = 113,
/**
* 114: The data size exceeds 1 KB when calling the sendStreamMessage method.
*/
ErrSizeTooLarge = 114,
/**
* 115: The data bitrate exceeds 6 KB/s when calling the sendStreamMessage method.
*/
ErrBitrateLimit = 115,
/**
* 116: More than five data streams are created when calling the createDataStream method.
*/
ErrTooManyDataStreams = 116,
/**
* 117: The data stream transmission times out.
*/
ErrStreamMessageTimeout = 117,
/**
* 119: Switching roles fails, try rejoining the channel.
*/
ErrSetClientRoleNotAuthorized = 119,
/**
* 120: Media streams decryption fails. The user might use an incorrect password to join the channel. Check the entered password, or tell the user to try rejoining the channel.
*/
ErrDecryptionFailed = 120,
/**
* 121: The user ID is invalid.
*/
ErrInvalidUserId = 121,
/**
* 122: Data streams decryption fails. The user might use an incorrect password to join the channel. Check the entered password, or tell the user to try rejoining the channel.
*/
ErrDatastreamDecryptionFailed = 122,
/**
* 123: The user is banned from the server.
*/
ErrClientIsBannedByServer = 123,
/**
* 130: The SDK does not support pushing encrypted streams to CDN.
*/
ErrEncryptedStreamNotAllowedPublish = 130,
/**
* @ignore
*/
ErrLicenseCredentialInvalid = 131,
/**
* 134: The user account is invalid, possibly because it contains invalid parameters.
*/
ErrInvalidUserAccount = 134,
/**
* @ignore
*/
ErrModuleNotFound = 157,
/**
* 1001: The SDK fails to load the media engine.
*/
ErrCertRaw = 157,
/**
* @ignore
*/
ErrCertJsonPart = 158,
/**
* @ignore
*/
ErrCertJsonInval = 159,
/**
* @ignore
*/
ErrCertJsonNomem = 160,
/**
* @ignore
*/
ErrCertCustom = 161,
/**
* @ignore
*/
ErrCertCredential = 162,
/**
* @ignore
*/
ErrCertSign = 163,
/**
* @ignore
*/
ErrCertFail = 164,
/**
* @ignore
*/
ErrCertBuf = 165,
/**
* @ignore
*/
ErrCertNull = 166,
/**
* @ignore
*/
ErrCertDuedate = 167,
/**
* @ignore
*/
ErrCertRequest = 168,
/**
* @ignore
*/
ErrPcmsendFormat = 200,
/**
* @ignore
*/
ErrPcmsendBufferoverflow = 201,
/**
* @ignore
*/
ErrLoginAlreadyLogin = 428,
/**
* @ignore
*/
ErrLoadMediaEngine = 1001,
/**
* 1005: A general error occurs (no specified reason). Check whether the audio device is already in use by another app, or try rejoining the channel.
*/
ErrAdmGeneralError = 1005,
/**
* 1008: An error occurs when initializing the playback device. Check whether the playback device is already in use by another app, or try rejoining the channel.
*/
ErrAdmInitPlayout = 1008,
/**
* 1009: An error occurs when starting the playback device. Check the playback device.
*/
ErrAdmStartPlayout = 1009,
/**
* 1010: An error occurs when stopping the playback device.
*/
ErrAdmStopPlayout = 1010,
/**
* 1011: An error occurs when initializing the recording device. Check the recording device, or try rejoining the channel.
*/
ErrAdmInitRecording = 1011,
/**
* 1012: An error occurs when starting the recording device. Check the recording device.
*/
ErrAdmStartRecording = 1012,
/**
* 1013: An error occurs when stopping the recording device.
*/
ErrAdmStopRecording = 1013,
/**
* 1501: Permission to access the camera is not granted. Check whether permission to access the camera permission is granted.
*/
ErrVdmCameraNotAuthorized = 1501,
}
/**
* @ignore
*/
export enum LicenseErrorType {
/**
* @ignore
*/
LicenseErrInvalid = 1,
/**
* @ignore
*/
LicenseErrExpire = 2,
/**
* @ignore
*/
LicenseErrMinutesExceed = 3,
/**
* @ignore
*/
LicenseErrLimitedPeriod = 4,
/**
* @ignore
*/
LicenseErrDiffDevices = 5,
/**
* @ignore
*/
LicenseErrInternal = 99,
}
/**
* The operation permissions of the SDK on the audio session.
*/
export enum AudioSessionOperationRestriction {
/**
* No restriction, the SDK can change the audio session.
*/
AudioSessionOperationRestrictionNone = 0,
/**
* The SDK cannot change the audio session category.
*/
AudioSessionOperationRestrictionSetCategory = 1,
/**
* The SDK cannot change the audio session category, mode, or categoryOptions.
*/
AudioSessionOperationRestrictionConfigureSession = 1 << 1,
/**
* The SDK keeps the audio session active when the user leaves the channel, for example, to play an audio file in the background.
*/
AudioSessionOperationRestrictionDeactivateSession = 1 << 2,
/**
* Completely restricts the operation permissions of the SDK on the audio session; the SDK cannot change the audio session.
*/
AudioSessionOperationRestrictionAll = 1 << 7,
}
/**
* Reasons for a user being offline.
*/
export enum UserOfflineReasonType {
/**
* 0: The user quits the call.
*/
UserOfflineQuit = 0,
/**
* 1: The SDK times out and the user drops offline because no data packet is received within a certain period of time. If the user quits the call and the message is not passed to the SDK (due to an unreliable channel), the SDK assumes the user dropped offline.
*/
UserOfflineDropped = 1,
/**
* 2: The user switches the client role from the host to the audience.
*/
UserOfflineBecomeAudience = 2,
}
/**
* The interface class.
*/
export enum InterfaceIdType {
/**
* 1: The IAudioDeviceManager interface class.
*/
AgoraIidAudioDeviceManager = 1,
/**
* 2: The IVideoDeviceManager interface class.
*/
AgoraIidVideoDeviceManager = 2,
/**
* @ignore
*/
AgoraIidParameterEngine = 3,
/**
* 4: The IMediaEngine interface class.
*/
AgoraIidMediaEngine = 4,
/**
* @ignore
*/
AgoraIidAudioEngine = 5,
/**
* @ignore
*/
AgoraIidVideoEngine = 6,
/**
* @ignore
*/
AgoraIidRtcConnection = 7,
/**
* @ignore
*/
AgoraIidSignalingEngine = 8,
/**
* @ignore
*/
AgoraIidMediaEngineRegulator = 9,
/**
* @ignore
*/
AgoraIidLocalSpatialAudio = 11,
/**
* @ignore
*/
AgoraIidStateSync = 13,
/**
* @ignore
*/
AgoraIidMetaService = 14,
/**
* @ignore
*/
AgoraIidMusicContentCenter = 15,
/**
* @ignore
*/
AgoraIidH265Transcoder = 16,
}
/**
* Network quality types.
*/
export enum QualityType {
/**
* 0: The network quality is unknown.
*/
QualityUnknown = 0,
/**
* 1: The network quality is excellent.
*/
QualityExcellent = 1,
/**
* 2: The network quality is quite good, but the bitrate may be slightly lower than excellent.
*/
QualityGood = 2,
/**
* 3: Users can feel the communication is slightly impaired.
*/
QualityPoor = 3,
/**
* 4: Users cannot communicate smoothly.
*/
QualityBad = 4,
/**
* 5: The quality is so bad that users can barely communicate.
*/
QualityVbad = 5,
/**
* 6: The network is down and users cannot communicate at all.
*/
QualityDown = 6,
/**
* @ignore
*/
QualityUnsupported = 7,
/**
* 8: The last-mile network probe test is in progress.
*/
QualityDetecting = 8,
}
/**
* @ignore
*/
export enum FitModeType {
/**
* @ignore
*/
ModeCover = 1,
/**
* @ignore
*/
ModeContain = 2,
}
/**
* The clockwise rotation of the video.
*/
export enum VideoOrientation {
/**
* 0: (Default) No rotation.
*/
VideoOrientation0 = 0,
/**
* 90: 90 degrees.
*/
VideoOrientation90 = 90,
/**
* 180: 180 degrees.
*/
VideoOrientation180 = 180,
/**
* 270: 270 degrees.
*/
VideoOrientation270 = 270,
}
/**
* The video frame rate.
*/
export enum FrameRate {
/**
* 1: 1 fps
*/
FrameRateFps1 = 1,
/**
* 7: 7 fps
*/
FrameRateFps7 = 7,
/**
* 10: 10 fps
*/
FrameRateFps10 = 10,
/**
* 15: 15 fps
*/
FrameRateFps15 = 15,
/**
* 24: 24 fps
*/
FrameRateFps24 = 24,
/**
* 30: 30 fps
*/
FrameRateFps30 = 30,
/**
* @ignore
*/
FrameRateFps60 = 60,
}
/**
* @ignore
*/
export enum FrameWidth {
/**
* @ignore
*/
FrameWidth960 = 960,
}
/**
* @ignore
*/
export enum FrameHeight {
/**
* @ignore
*/
FrameHeight540 = 540,
}
/**
* The video frame type.
*/
export enum VideoFrameType {
/**
* 0: A black frame.
*/
VideoFrameTypeBlankFrame = 0,
/**
* 3: Key frame.
*/
VideoFrameTypeKeyFrame = 3,
/**
* 4: Delta frame.
*/
VideoFrameTypeDeltaFrame = 4,
/**
* 5: The B frame.
*/
VideoFrameTypeBFrame = 5,
/**
* 6: A discarded frame.
*/
VideoFrameTypeDroppableFrame = 6,
/**
* Unknown frame.
*/
VideoFrameTypeUnknow = 7,
}
/**
* Video output orientation mode.
*/
export enum OrientationMode {
/**
* 0: (Default) The output video always follows the orientation of the captured video. The receiver takes the rotational information passed on from the video encoder. This mode applies to scenarios where video orientation can be adjusted on the receiver.
* If the captured video is in landscape mode, the output video is in landscape mode.
* If the captured video is in portrait mode, the output video is in portrait mode.
*/
OrientationModeAdaptive = 0,
/**
* @ignore
*/
OrientationModeFixedLandscape = 1,
/**
* @ignore
*/
OrientationModeFixedPortrait = 2,
}
/**
* Video degradation preferences when the bandwidth is a constraint.
*/
export enum DegradationPreference {
/**
* 0: (Default) Automatic mode. The SDK will automatically select MaintainFramerate, MaintainBalanced or MaintainResolution based on the video scenario you set, in order to achieve the best overall quality of experience (QoE).
*/
MaintainAuto = -1,
/**
* 0: Prefers to reduce the video frame rate while maintaining video resolution during video encoding under limited bandwidth. This degradation preference is suitable for scenarios where video quality is prioritized. Deprecated: This enumerator is deprecated. Use other enumerations instead.
*/
MaintainQuality = 0,
/**
* 1: Reduces the video resolution while maintaining the video frame rate during video encoding under limited bandwidth. This degradation preference is suitable for scenarios where smoothness is prioritized and video quality is allowed to be reduced.
*/
MaintainFramerate = 1,
/**
* 2: Reduces the video frame rate and video resolution simultaneously during video encoding under limited bandwidth. The MaintainBalanced has a lower reduction than MaintainQuality and MaintainFramerate, and this preference is suitable for scenarios where both smoothness and video quality are a priority. The resolution of the video sent may change, so remote users need to handle this issue. See onVideoSizeChanged.
*/
MaintainBalanced = 2,
/**
* 3: Reduces the video frame rate while maintaining the video resolution during video encoding under limited bandwidth. This degradation preference is suitable for scenarios where video quality is prioritized.
*/
MaintainResolution = 3,
/**
* @ignore
*/
Disabled = 100,
}
/**
* The video dimension.
*/
export class VideoDimensions {
/**
* The width (pixels) of the video.
*/
width?: number;
/**
* The height (pixels) of the video.
*/
height?: number;
}
/**
* The highest frame rate supported by the screen sharing device.
*/
export enum ScreenCaptureFramerateCapability {
/**
* 0: The device supports the frame rate of up to 15 fps.
*/
ScreenCaptureFramerateCapability15Fps = 0,
/**
* 1: The device supports the frame rate of up to 30 fps.
*/
ScreenCaptureFramerateCapability30Fps = 1,
/**
* 2: The device supports the frame rate of up to 60 fps.
*/
ScreenCaptureFramerateCapability60Fps = 2,
}
/**
* @ignore
*/
export enum VideoCodecCapabilityLevel {
/**
* @ignore
*/
CodecCapabilityLevelUnspecified = -1,
/**
* @ignore
*/
CodecCapabilityLevelBasicSupport = 5,
/**
* @ignore
*/
CodecCapabilityLevel1080p30fps = 10,
/**
* @ignore
*/
CodecCapabilityLevel1080p60fps = 20,
/**
* @ignore
*/
CodecCapabilityLevel4k60fps = 30,
}
/**
* Video codec types.
*/
export enum VideoCodecType {
/**
* 0: (Default) Unspecified codec format. The SDK automatically matches the appropriate codec format based on the current video stream's resolution and device performance.
*/
VideoCodecNone = 0,
/**
* 1: Standard VP8.
*/
VideoCodecVp8 = 1,
/**
* 2: Standard H.264.
*/
VideoCodecH264 = 2,
/**
* 3: Standard H.265.
*/
VideoCodecH265 = 3,
/**
* 6: Generic. This type is used for transmitting raw video data, such as encrypted video frames. The SDK returns this type of video frames in callbacks, and you need to decode and render the frames yourself.
*/
VideoCodecGeneric = 6,
/**
* @ignore
*/
VideoCodecGenericH264 = 7,
/**
* @ignore
*/
VideoCodecAv1 = 12,
/**
* @ignore
*/
VideoCodecVp9 = 13,
/**
* 20: Generic JPEG. This type consumes minimum computing resources and applies to IoT devices.
*/
VideoCodecGenericJpeg = 20,
}
/**
* The camera focal length types.
*/
export enum CameraFocalLengthType {
/**
* 0: (Default) Standard lens.
*/
CameraFocalLengthDefault = 0,
/**
* 1: Wide-angle lens.
*/
CameraFocalLengthWideAngle = 1,
/**
* 2: Ultra-wide-angle lens.
*/
CameraFocalLengthUltraWide = 2,
/**
* 3: (For iOS only) Telephoto lens.
*/
CameraFocalLengthTelephoto = 3,
}
/**
* @ignore
*/
export enum TCcMode {
/**
* @ignore
*/
CcEnabled = 0,
/**
* @ignore
*/
CcDisabled = 1,
}
/**
* @ignore
*/
export class SenderOptions {
/**
* @ignore
*/
ccMode?: TCcMode;
/**
* @ignore
*/
codecType?: VideoCodecType;
/**
* @ignore
*/
targetBitrate?: number;
}
/**
* The codec type of audio.
*/
export enum AudioCodecType {
/**
* 1: OPUS.
*/
AudioCodecOpus = 1,
/**
* 3: PCMA.
*/
AudioCodecPcma = 3,
/**
* 4: PCMU.
*/
AudioCodecPcmu = 4,
/**
* 5: G722.
*/
AudioCodecG722 = 5,
/**
* 8: LC-AAC.
*/
AudioCodecAaclc = 8,
/**
* 9: HE-AAC.
*/
AudioCodecHeaac = 9,
/**
* 10: JC1.
*/
AudioCodecJc1 = 10,
/**
* 11: HE-AAC v2.
*/
AudioCodecHeaac2 = 11,
/**
* @ignore
*/
AudioCodecLpcnet = 12,
/**
* @ignore
*/