@tencent-rtc/mcp 1.2.7 → 1.2.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.
Files changed (32) hide show
  1. package/package.json +1 -1
  2. package/resource/doc/native_live/android/V2TXLiveCode_api_android.md +312 -0
  3. package/resource/doc/native_live/android/V2TXLiveDef_api_android.md +430 -0
  4. package/resource/doc/native_live/android/V2TXLivePlayerObserver_api_android.md +679 -0
  5. package/resource/doc/native_live/android/V2TXLivePlayer_api_android.md +671 -0
  6. package/resource/doc/native_live/android/V2TXLivePremier_api_android.md +271 -0
  7. package/resource/doc/native_live/android/V2TXLivePusherObserver_api_android.md +849 -0
  8. package/resource/doc/native_live/android/V2TXLivePusher_api_android.md +1046 -0
  9. package/resource/doc/native_live/flutter/V2TXLiveCode_api_flutter.md +460 -0
  10. package/resource/doc/native_live/flutter/V2TXLiveDef_api_flutter.md +558 -0
  11. package/resource/doc/native_live/flutter/V2TXLivePlayerObserver_api_flutter.md +865 -0
  12. package/resource/doc/native_live/flutter/V2TXLivePlayer_api_flutter.md +657 -0
  13. package/resource/doc/native_live/flutter/V2TXLivePremier_api_flutter.md +437 -0
  14. package/resource/doc/native_live/flutter/V2TXLivePusherObserver_api_flutter.md +335 -0
  15. package/resource/doc/native_live/flutter/V2TXLivePusher_api_flutter.md +748 -0
  16. package/resource/doc/native_live/iOS/V2TXLiveCode_api_iOS.md +327 -0
  17. package/resource/doc/native_live/iOS/V2TXLiveDef_api_iOS.md +507 -0
  18. package/resource/doc/native_live/iOS/V2TXLivePlayerObserver_api_iOS.md +507 -0
  19. package/resource/doc/native_live/iOS/V2TXLivePlayer_api_iOS.md +659 -0
  20. package/resource/doc/native_live/iOS/V2TXLivePremier_api_iOS.md +284 -0
  21. package/resource/doc/native_live/iOS/V2TXLivePusherObserver_api_iOS.md +814 -0
  22. package/resource/doc/native_live/iOS/V2TXLivePusher_api_iOS.md +1000 -0
  23. package/tools/common/get-faq.js +1 -1
  24. package/tools/common/get-faq.js.map +1 -1
  25. package/tools/definitions/get_native_live_api_def.js +23 -0
  26. package/tools/definitions/get_native_live_api_def.js.map +1 -0
  27. package/tools/index.js +4 -0
  28. package/tools/index.js.map +1 -1
  29. package/tools/native_live/get-native-live-api.js +31 -0
  30. package/tools/native_live/get-native-live-api.js.map +1 -0
  31. package/utils/report-cls-client.js +1 -1
  32. package/utils/report-es-client.js +1 -1
@@ -0,0 +1,284 @@
1
+ # Tencent Cloud Live Streaming SDK V2TXLivePremier API Documentation
2
+
3
+ ## Feature Overview
4
+
5
+ `V2TXLivePremier` is the advanced API class in the Tencent Cloud Live Streaming (CSS) SDK. It provides global configuration and management for the SDK, including initialization, license management, environment setup, audio data callbacks, and experimental API access.
6
+
7
+ **Platform Support**: iOS, macOS
8
+ **Feature Scope**: SDK initialization, license management, environment configuration, audio data callbacks, experimental APIs
9
+
10
+ ## 📋 Table of Contents
11
+
12
+ ### 1. [V2TXLivePremier APIs](#v2txlivepremier接口)
13
+ ### 2. [V2TXLivePremierObserver Callback Interfaces](#v2txlivepremierobserver回调接口)
14
+
15
+ ## 1. V2TXLivePremier APIs
16
+
17
+ ### 🔧 getSDKVersionStr - Retrieve SDK Version
18
+
19
+ ```objc
20
+ + (NSString *)getSDKVersionStr;
21
+ ```
22
+
23
+ **Description**: Returns the current SDK version as a string.
24
+
25
+ **Return Value**:
26
+ - `NSString*`: SDK version string, for example: "10.7.0.12345"
27
+
28
+ **Typical Use Cases**:
29
+ - Checking version compatibility
30
+ - Providing version details for troubleshooting
31
+ - Reporting and monitoring
32
+
33
+ **Example**:
34
+ ```objc
35
+ NSString *version = [V2TXLivePremier getSDKVersionStr];
36
+ NSLog(@"Current SDK version: %@", version);
37
+ ```
38
+
39
+ ### setObserver - Set Global Callback Interface
40
+
41
+ ```objc
42
+ + (void)setObserver:(id<V2TXLivePremierObserver>)observer;
43
+ ```
44
+
45
+ **Parameters**:
46
+ - `observer`: Object conforming to the V2TXLivePremierObserver protocol
47
+
48
+ **Usage Recommendation**: Set the observer once during app startup. The observer remains active throughout the app lifecycle.
49
+
50
+ **Notes**:
51
+ - Set the observer only once at startup.
52
+ - Ensure the observer object is valid for the entire app lifecycle.
53
+
54
+ ### setLogConfig - Configure Logging
55
+
56
+ ```objc
57
+ + (V2TXLiveCode)setLogConfig:(V2TXLiveLogConfig *)config;
58
+ ```
59
+
60
+ **Parameters**:
61
+ - `config`: Log configuration object (log level, storage path, etc.)
62
+
63
+ **Usage Recommendation**: Configure logging at app startup for global effect.
64
+
65
+ **Typical Use Cases**:
66
+ - Enable detailed logging for debugging
67
+ - Minimize log output in production
68
+ - Customize log storage location
69
+
70
+ **Example**:
71
+ ```objc
72
+ V2TXLiveLogConfig *logConfig = [[V2TXLiveLogConfig alloc] init];
73
+ logConfig.enableConsole = YES;
74
+ logConfig.enableLogFile = YES;
75
+ logConfig.enableObserver = YES;
76
+ logConfig.logLevel = V2TXLiveLogLevelAll;
77
+ [V2TXLivePremier setObserver:self];
78
+ [V2TXLivePremier setLogConfig:logConfig];
79
+ ```
80
+
81
+ ### setEnvironment - Select SDK Access Environment
82
+
83
+ ```objc
84
+ + (V2TXLiveCode)setEnvironment:(const char *)env;
85
+ ```
86
+
87
+ **Parameters**:
88
+ - `env`: Environment identifier. Options:
89
+ - `"default"`: Default environment; SDK automatically selects the best global access point
90
+ - `"GDPR"`: GDPR-compliant environment; audio/video data does not route through servers in mainland China
91
+
92
+ **Note**: Only use this API if you have specific environment requirements.
93
+
94
+ ### setLicence - Set SDK License
95
+
96
+ ```objc
97
+ + (void)setLicence:(NSString *)url key:(NSString *)key;
98
+ ```
99
+
100
+ **Parameters**:
101
+ - `url`: License URL
102
+ - `key`: License key
103
+
104
+ **Usage Recommendation**: Set the license during app startup. You must configure the license before starting stream publishing or playback.
105
+
106
+ **Reference Documentation**: https://cloud.tencent.com/document/product/454/34750
107
+
108
+ **Example**:
109
+ ```objc
110
+ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
111
+ [V2TXLivePremier setObserver:self];
112
+ [V2TXLivePremier setLicence:@"your_licence_url" key:@"your_licence_key"];
113
+ return YES;
114
+ }
115
+
116
+ #pragma mark - V2TXLivePremierObserver
117
+ - (void)onLicenceLoaded:(int)result Reason:(NSString *)reason {
118
+ if (result == 0) {
119
+ NSLog(@"Licence loaded successfully, %@", reason);
120
+ } else if (result == -4) {
121
+ NSLog(@"Licence package name mismatch, %@", reason);
122
+ } else if (result == -11) {
123
+ NSLog(@"Licence expired, %@", reason);
124
+ } else {
125
+ NSLog(@"Licence other error, %@", reason);
126
+ }
127
+ }
128
+ ```
129
+
130
+ ### setSocks5Proxy - Configure SOCKS5 Proxy
131
+
132
+ ```objc
133
+ + (V2TXLiveCode)setSocks5Proxy:(NSString *)host
134
+ port:(NSInteger)port
135
+ username:(NSString *)username
136
+ password:(NSString *)password
137
+ config:(V2TXLiveSocks5ProxyConfig *)config;
138
+ ```
139
+
140
+ **Parameters**:
141
+ - `host`: SOCKS5 proxy server address
142
+ - `port`: SOCKS5 proxy server port
143
+ - `username`: Proxy username
144
+ - `password`: Proxy password
145
+ - `config`: SOCKS5 proxy configuration object
146
+
147
+ **Usage Recommendation**: Configure the proxy during app startup.
148
+
149
+ ### enableAudioCaptureObserver - Enable/Disable Audio Capture Callback
150
+
151
+ ```objc
152
+ + (V2TXLiveCode)enableAudioCaptureObserver:(BOOL)enable
153
+ format:(V2TXLiveAudioFrameObserverFormat *)format;
154
+ ```
155
+
156
+ **Parameters**:
157
+ - `enable`: Enable or disable callback (default: NO)
158
+ - `format`: Audio frame callback format
159
+
160
+ **Usage Recommendation**: Call before invoking `V2TXLivePusher#startPush`.
161
+
162
+ ### enableAudioPlayoutObserver - Enable/Disable Mixed Audio Playback Callback
163
+
164
+ ```objc
165
+ + (V2TXLiveCode)enableAudioPlayoutObserver:(BOOL)enable
166
+ format:(V2TXLiveAudioFrameObserverFormat *)format;
167
+ ```
168
+
169
+ **Parameters**:
170
+ - `enable`: Enable or disable callback (default: NO)
171
+ - `format`: Audio frame callback format
172
+
173
+ **Technical Details**:
174
+ - Audio frame duration: 0.02s (fixed)
175
+ - PCM audio format
176
+ - Data includes all mixed playback audio streams
177
+
178
+ ### enableVoiceEarMonitorObserver - Enable/Disable Ear Monitor Audio Callback
179
+
180
+ ```objc
181
+ + (V2TXLiveCode)enableVoiceEarMonitorObserver:(BOOL)enable;
182
+ ```
183
+
184
+ **Parameters**:
185
+ - `enable`: Enable or disable callback (default: NO)
186
+
187
+ **Technical Details**:
188
+ - Audio frame duration: variable
189
+ - PCM audio format
190
+ - Dedicated ear monitor audio stream
191
+
192
+ ### setUserId - Set User Identifier
193
+
194
+ ```objc
195
+ + (void)setUserId:(NSString *)userId;
196
+ ```
197
+
198
+ **Parameters**:
199
+ - `userId`: User or device identifier managed by your business logic
200
+
201
+ **Usage Recommendation**: Set during app startup.
202
+
203
+ ### callExperimentalAPI - Invoke Experimental API
204
+
205
+ ```objc
206
+ + (V2TXLiveCode)callExperimentalAPI:(NSString *)jsonStr;
207
+ ```
208
+
209
+ **Parameters**:
210
+ - `jsonStr`: JSON string specifying the API and parameters
211
+
212
+ **Return Value**:
213
+ - `V2TXLIVE_OK`: Success
214
+ - `V2TXLIVE_ERROR_INVALID_PARAMETER`: Invalid parameter
215
+
216
+ ## 2. V2TXLivePremierObserver Callback Interfaces
217
+
218
+ ### onLog - Custom Log Output
219
+
220
+ ```objc
221
+ - (void)onLog:(V2TXLiveLogLevel)level log:(NSString *)log;
222
+ ```
223
+
224
+ **Parameters**:
225
+ - `level`: Log level
226
+ - `log`: Log message
227
+
228
+ **Typical Use Cases**:
229
+ - Custom log processing
230
+ - Redirect logs to external systems
231
+ - Filter and format log output
232
+
233
+ ### onLicenceLoaded - License Load Result
234
+
235
+ ```objc
236
+ - (void)onLicenceLoaded:(int)result Reason:(NSString *)reason;
237
+ ```
238
+
239
+ **Parameters**:
240
+ - `result`: Result code (0 for success, negative values indicate failure)
241
+ - `reason`: Failure reason
242
+
243
+ ### onCaptureAudioFrame - Microphone Audio Data Callback
244
+
245
+ ```objc
246
+ - (void)onCaptureAudioFrame:(V2TXLiveAudioFrame *)frame;
247
+ ```
248
+
249
+ **Parameters**:
250
+ - `frame`: Captured audio data frame
251
+
252
+ **Important Notes**:
253
+ - Avoid time-consuming operations in this callback
254
+ - You can modify the audio data
255
+ - Frame duration is 0.02s (fixed)
256
+ - Does not include background music, sound effects, or pre-processing
257
+ - Ultra-low latency
258
+
259
+ ### onPlayoutAudioFrame - Mixed Playback Audio Data Callback
260
+
261
+ ```objc
262
+ - (void)onPlayoutAudioFrame:(V2TXLiveAudioFrame *)frame;
263
+ ```
264
+
265
+ **Parameters**:
266
+ - `frame`: PCM audio data frame
267
+
268
+ **Important Notes**:
269
+ - Frame duration is 0.02s (fixed)
270
+ - Data is readable and writable; ensure efficient processing
271
+ - Ear monitor audio is not included
272
+
273
+ ### onVoiceEarMonitorAudioFrame - Ear Monitor Audio Data Callback
274
+
275
+ ```objc
276
+ - (void)onVoiceEarMonitorAudioFrame:(V2TXLiveAudioFrame *)frame;
277
+ ```
278
+
279
+ **Parameters**:
280
+ - `frame`: PCM audio data frame
281
+
282
+ **Important Notes**:
283
+ - Frame duration is variable
284
+ - Data is readable and writable; ensure efficient processing