@byteplus/react-native-live-pull 1.0.0

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 (52) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2 -0
  3. package/android/build.gradle +93 -0
  4. package/android/gradle.properties +5 -0
  5. package/android/src/main/AndroidManifest.xml +9 -0
  6. package/android/src/main/AndroidManifestNew.xml +8 -0
  7. package/android/src/main/java/com/volcengine/velive/rn/pull/NativeVariableManager.java +15 -0
  8. package/android/src/main/java/com/volcengine/velive/rn/pull/VolcLiveModule.java +108 -0
  9. package/android/src/main/java/com/volcengine/velive/rn/pull/VolcLiveModuleSpec.java +17 -0
  10. package/android/src/main/java/com/volcengine/velive/rn/pull/VolcLivePackage.java +27 -0
  11. package/android/src/main/java/com/volcengine/velive/rn/pull/VolcView.java +32 -0
  12. package/android/src/main/java/com/volcengine/velive/rn/pull/VolcViewManager.java +87 -0
  13. package/android/src/main/java/com/volcengine/velive/rn/pull/autogen/MethodSignature.java +129 -0
  14. package/ios/VeLivePullSDK.h +24 -0
  15. package/ios/VeLivePullSDK.m +91 -0
  16. package/ios/VeLivePullView.h +25 -0
  17. package/ios/VeLivePullView.m +74 -0
  18. package/ios/VeLivePullViewManager.m +59 -0
  19. package/lib/commonjs/index.js +10697 -0
  20. package/lib/module/index.js +10684 -0
  21. package/lib/typescript/codegen/android/api.d.ts +61 -0
  22. package/lib/typescript/codegen/android/callback.d.ts +40 -0
  23. package/lib/typescript/codegen/android/errorcode.d.ts +53 -0
  24. package/lib/typescript/codegen/android/index.d.ts +5 -0
  25. package/lib/typescript/codegen/android/keytype.d.ts +263 -0
  26. package/lib/typescript/codegen/android/types.d.ts +30 -0
  27. package/lib/typescript/codegen/ios/api.d.ts +81 -0
  28. package/lib/typescript/codegen/ios/callback.d.ts +44 -0
  29. package/lib/typescript/codegen/ios/errorcode.d.ts +56 -0
  30. package/lib/typescript/codegen/ios/index.d.ts +5 -0
  31. package/lib/typescript/codegen/ios/keytype.d.ts +271 -0
  32. package/lib/typescript/codegen/ios/types.d.ts +35 -0
  33. package/lib/typescript/codegen/pack/api.d.ts +381 -0
  34. package/lib/typescript/codegen/pack/callback.d.ts +217 -0
  35. package/lib/typescript/codegen/pack/errorcode.d.ts +150 -0
  36. package/lib/typescript/codegen/pack/index.d.ts +5 -0
  37. package/lib/typescript/codegen/pack/keytype.d.ts +931 -0
  38. package/lib/typescript/codegen/pack/types.d.ts +1 -0
  39. package/lib/typescript/component.d.ts +8 -0
  40. package/lib/typescript/core/api.d.ts +1 -0
  41. package/lib/typescript/core/callback.d.ts +1 -0
  42. package/lib/typescript/core/env.d.ts +38 -0
  43. package/lib/typescript/core/errorcode.d.ts +1 -0
  44. package/lib/typescript/core/index.d.ts +6 -0
  45. package/lib/typescript/core/keytype.d.ts +1 -0
  46. package/lib/typescript/core/player.d.ts +16 -0
  47. package/lib/typescript/index.d.ts +2 -0
  48. package/lib/typescript/platforms/android/extends.d.ts +39 -0
  49. package/lib/typescript/platforms/ios/extends.d.ts +41 -0
  50. package/lib/typescript/runtime/index.d.ts +1 -0
  51. package/package.json +32 -0
  52. package/react-native-velive-pull.podspec +45 -0
@@ -0,0 +1,271 @@
1
+ import { BOOL, NSInteger, NSString, int, CMTime, NSData, int64_t, CVPixelBufferRef, CMSampleBufferRef, NSArray, NSURL, long, float } from './types';
2
+ export declare enum VeLivePlayerBMFFlexSRType {
3
+
4
+ VeLivePlayerBMFScale_Unknow = -1,
5
+
6
+ VeLivePlayerBMFScale_1_5 = 0,
7
+
8
+ VeLivePlayerBMFScale_2_0 = 1,
9
+
10
+ VeLivePlayerBMFScale_1_1 = 2,
11
+
12
+ VeLivePlayerBMFScale_1_2 = 3,
13
+
14
+ VeLivePlayerBMFScale_1_3 = 4,
15
+
16
+ VeLivePlayerBMFScale_1_4 = 5
17
+ }
18
+ export declare enum VeLivePlayerResolutionSwitchReason {
19
+
20
+ VeLivePlayerResolutionSwitchByAuto = 0,
21
+
22
+ VeLivePlayerResolutionSwitchByManual = 1
23
+ }
24
+ export declare class VeLivePlayerConfiguration {
25
+
26
+ enableSei: BOOL;
27
+
28
+ enableHardwareDecode: BOOL;
29
+
30
+ enableLiveDNS: BOOL;
31
+
32
+ enableStatisticsCallback: BOOL;
33
+
34
+ statisticsCallbackInterval: NSInteger;
35
+
36
+ networkTimeoutMs: NSInteger;
37
+
38
+ retryIntervalTimeMs: NSInteger;
39
+
40
+ retryMaxCount: NSInteger;
41
+
42
+ init(): this;
43
+ }
44
+ export declare class VeLivePlayerStream {
45
+
46
+ url: NSString;
47
+
48
+ resolution: VeLivePlayerResolution;
49
+
50
+ bitrate: int;
51
+
52
+ protocol: VeLivePlayerProtocol;
53
+
54
+ format: VeLivePlayerFormat;
55
+
56
+ type: VeLivePlayerStreamType;
57
+
58
+ init(): this;
59
+ }
60
+ export declare enum VeLivePlayerLogLevel {
61
+
62
+ VeLivePlayerLogLevelVerbose = 0,
63
+
64
+ VeLivePlayerLogLevelDebug = 1,
65
+
66
+ VeLivePlayerLogLevelInfo = 2,
67
+
68
+ VeLivePlayerLogLevelWarn = 3,
69
+
70
+ VeLivePlayerLogLevelError = 4,
71
+
72
+ VeLivePlayerLogLevelNone = 5
73
+ }
74
+ export declare class VeLivePlayerAudioFrame {
75
+
76
+ bufferType: VeLivePlayerAudioBufferType;
77
+
78
+ sampleRate: int;
79
+
80
+ channels: int;
81
+
82
+ bitDepth: int;
83
+
84
+ pts: CMTime;
85
+
86
+ data: NSData;
87
+
88
+ samples: int;
89
+ init(): this;
90
+ }
91
+ export declare class VeLivePlayerVideoFrame {
92
+
93
+ bufferType: VeLivePlayerVideoBufferType;
94
+
95
+ pixelFormat: VeLivePlayerPixelFormat;
96
+
97
+ width: NSInteger;
98
+
99
+ height: NSInteger;
100
+
101
+ pts: int64_t;
102
+
103
+ pixelBuffer: CVPixelBufferRef;
104
+
105
+ sampleBuffer: CMSampleBufferRef;
106
+
107
+ data: NSData;
108
+ init(): this;
109
+ }
110
+ export declare class VeLivePlayerStreamData {
111
+
112
+ enableABR: BOOL;
113
+
114
+ enableMainBackupSwitch: BOOL;
115
+
116
+ defaultResolution: VeLivePlayerResolution;
117
+
118
+ defaultFormat: VeLivePlayerFormat;
119
+
120
+ defaultProtocol: VeLivePlayerProtocol;
121
+
122
+ mainStream: NSArray<VeLivePlayerStream>;
123
+
124
+ backupStream: NSArray<VeLivePlayerStream>;
125
+ init(): this;
126
+ }
127
+ export declare enum VeLivePlayerAudioBufferType {
128
+
129
+ VeLivePlayerAudioBufferUnknown = 0,
130
+
131
+ VeLivePlayerAudioBufferTypeSampleBuffer = 1,
132
+
133
+ VeLivePlayerAudioBufferTypeNSData = 2
134
+ }
135
+ export declare enum VeLivePlayerVideoBufferType {
136
+
137
+ VeLivePlayerVideoBufferTypeUnknown = 0,
138
+
139
+ VeLivePlayerVideoBufferTypePixelBuffer = 1,
140
+
141
+ VeLivePlayerVideoBufferTypeSampleBuffer = 2,
142
+
143
+ VeLivePlayerVideoBufferTypeNSData = 3
144
+ }
145
+ export declare enum VeLivePlayerBMFFlexSRErrorCode {
146
+
147
+ VeLivePlayerBMFFlexSRErrorUnknow = 0,
148
+
149
+ VeLivePlayerBMFFlexSRErrorCondition = 1,
150
+
151
+ VeLivePlayerBMFFlexSRErrorSRType = 2,
152
+
153
+ VeLivePlayerBMFFlexSRErrorSRTypeSame = 3,
154
+
155
+ VeLivePlayerBMFFlexSRErrorProcessFailed = 4,
156
+
157
+ VeLivePlayerBMFFlexSRSuccess = 5
158
+ }
159
+ export declare enum VeLivePlayerProtocol {
160
+
161
+ VeLivePlayerProtocolTCP = 0,
162
+
163
+ VeLivePlayerProtocolQUIC = 1,
164
+
165
+ VeLivePlayerProtocolTLS = 2
166
+ }
167
+ export declare enum VeLivePlayerFillMode {
168
+
169
+ VeLivePlayerFillModeAspectFill = 0,
170
+
171
+ VeLivePlayerFillModeAspectFit = 1,
172
+
173
+ VeLivePlayerFillModeFullFill = 2
174
+ }
175
+ export declare enum VeLivePlayerRotation {
176
+
177
+ VeLivePlayerRotation0 = 0,
178
+
179
+ VeLivePlayerRotation90 = 90,
180
+
181
+ VeLivePlayerRotation180 = 180,
182
+
183
+ VeLivePlayerRotation270 = 270
184
+ }
185
+ export declare enum VeLivePlayerMirror {
186
+
187
+ VeLivePlayerMirrorNone = 0,
188
+
189
+ VeLivePlayerMirrorHorizontal = 1,
190
+
191
+ VeLivePlayerMirrorVertical = 2
192
+ }
193
+ export declare enum VeLivePlayerPixelFormat {
194
+
195
+ VeLivePlayerPixelFormatUnknown = 0,
196
+
197
+ VeLivePlayerPixelFormatNV12 = 1,
198
+
199
+ VeLivePlayerPixelFormatI420 = 2,
200
+
201
+ VeLivePlayerPixelFormatBGRA32 = 3
202
+ }
203
+ export declare enum VeLivePlayerStatus {
204
+
205
+ VeLivePlayerStatusPrepared = 0,
206
+
207
+ VeLivePlayerStatusPlaying = 1,
208
+
209
+ VeLivePlayerStatusPaused = 2,
210
+
211
+ VeLivePlayerStatusStopped = 3,
212
+
213
+ VeLivePlayerStatusError = 4
214
+ }
215
+ export declare class VeLivePlayerStatistics {
216
+
217
+ url: NSURL;
218
+
219
+ isHardWareDecode: BOOL;
220
+
221
+ delayMs: int;
222
+
223
+ stallTimeMs: int;
224
+
225
+ bandwidthEstimation: long;
226
+
227
+ videoCodec: NSString;
228
+
229
+ width: int;
230
+
231
+ height: int;
232
+
233
+ fps: float;
234
+
235
+ bitrate: long;
236
+
237
+ videoBufferMs: long;
238
+
239
+ audioBufferMs: long;
240
+
241
+ format: VeLivePlayerFormat;
242
+
243
+ protocol: VeLivePlayerProtocol;
244
+ init(): this;
245
+ }
246
+ export declare enum VeLivePlayerStreamType {
247
+
248
+ VeLivePlayerStreamTypeMain = 0,
249
+
250
+ VeLivePlayerStreamTypeBackup = 1
251
+ }
252
+ export declare enum VeLivePlayerFormat {
253
+
254
+ VeLivePlayerFormatFLV = 0,
255
+
256
+ VeLivePlayerFormatHLS = 1,
257
+
258
+ VeLivePlayerFormatRTM = 2
259
+ }
260
+ export declare enum VeLivePlayerResolution {
261
+
262
+ VeLivePlayerResolutionOrigin = 0,
263
+
264
+ VeLivePlayerResolutionUHD = 1,
265
+
266
+ VeLivePlayerResolutionHD = 2,
267
+
268
+ VeLivePlayerResolutionSD = 3,
269
+
270
+ VeLivePlayerResolutionLD = 4
271
+ }
@@ -0,0 +1,35 @@
1
+ export type id<T = any> = T;
2
+ export type BOOL = boolean;
3
+ export type int = number;
4
+ export type long = number;
5
+ export type float = number;
6
+ export type int64_t = number;
7
+ export type NSString = string;
8
+ export type NSMutableString = string;
9
+ export type NSInteger = number;
10
+ export type NSUInteger = number;
11
+ export type NSNumber = number;
12
+ export type NSValue = number;
13
+ export type NSNull = null;
14
+ export type NSArray<T> = Array<T>;
15
+ export type NSMutableArray<T> = Array<T>;
16
+ export type NSObject = Object;
17
+ export type NSDictionary = Object;
18
+ export type NSMutableDictionary = Object;
19
+ export type NSDate = Date;
20
+ export type NSData = ArrayBuffer;
21
+ export type NSURL = string;
22
+ export type NSError = {
23
+ code: number;
24
+ domain: string;
25
+ };
26
+ export type NSTimeInterval = number;
27
+ export type UIView = any;
28
+ export type UIImage = unknown;
29
+ export type CVPixelBufferRef = any;
30
+ export type CMSampleBufferRef = any;
31
+ export type CMTime = number;
32
+ export type GLuint = number;
33
+ export type CGFloat = number;
34
+ export type CGPoint = any;
35
+ export type EAGLContext = any;
@@ -0,0 +1,381 @@
1
+ import { VeLivePlayerConfiguration, VeLivePlayerFillMode, VeLivePlayerStreamData, VeLivePlayerResolution, VeLivePlayerPixelFormat, VeLivePlayerVideoBufferType, VeLivePlayerRotation, VeLivePlayerMirror, VeLivePlayerLogLevel } from './keytype';
2
+ import { VeLivePlayerObserver } from './callback';
3
+ import { ApplicationContext } from '../../platforms/android/extends';
4
+ import * as $p_a from '../android/index';
5
+ import * as $p_i from '../ios/index';
6
+
7
+ /** {en}
8
+ * @detail api
9
+ * @brief The live player.
10
+ */
11
+ export declare class VeLivePlayer {
12
+
13
+ /** {en}
14
+ * @detail api
15
+ * @brief Gets the version number of the Player SDK.
16
+ * @return <br>
17
+ * The version number of the Player SDK.
18
+ * @order 4
19
+ */
20
+ static getVersion(): string;
21
+
22
+ /** {en}
23
+ * @detail api
24
+ * @brief Sets the level of the output log.
25
+ * @param logLevel The level of the output log. For details, see {@link #VeLivePlayerLogLevel VeLivePlayerLogLevel}.
26
+ * @order 5
27
+ */
28
+ static setLogLevel(logLevel: VeLivePlayerLogLevel): void;
29
+
30
+ /** {en}
31
+ * @platform ios
32
+ * @brief Sets the mapping of domain names to server IP addresses.
33
+ * @param hostIpMap The mapping of domain names to server IP addresses. The `Map` object uses the domain name as the key, and the corresponding value is a list of IP addresses for the servers associated with that domain. The value is of the `List` type.
34
+ */
35
+ static ios_setHttpDNSHostIP(hostIpMap: Object): void;
36
+ constructor(context: ApplicationContext);
37
+ protected _instance: any;
38
+ protected __init(...args: any[]): void;
39
+ protected __new_instance(...args: any[]): $p_a.VeLivePlayer | $p_i.TVLManager;
40
+
41
+ /** {en}
42
+ * @platform ios
43
+ * @detail keytype
44
+ * @brief The player observer.
45
+ */
46
+ get ios_observer(): $p_i.id<$p_i.VeLivePlayerObserver>;
47
+ set ios_observer(value: $p_i.id<$p_i.VeLivePlayerObserver>);
48
+
49
+ /** {en}
50
+ * @platform ios
51
+ * @detail keytype
52
+ * @brief The view used by the player to render video. Add `playerView` to the view hierarchy of your app to display the video content.
53
+ */
54
+ get ios_playerView(): $p_i.UIView;
55
+ set ios_playerView(value: $p_i.UIView);
56
+
57
+ /** {en}
58
+ * @detail api
59
+ * @brief Initializes the player and configures whether to turn on SEI messaging, hardware decoding, local DNS prefetch, and other configurations.
60
+ * @notes <br>Call this method to initialize the player before calling [play](#VeLivePlayer-play) .
61
+ * @order 1
62
+ * @param config Player configurations. Refer to VeLivePlayerConfiguration {@link #VeLivePlayerConfiguration} for details.
63
+ */
64
+ setConfig(config: VeLivePlayerConfiguration): void;
65
+
66
+ /** {en}
67
+ * @detail api
68
+ * @brief Sets the player observer to listen to the live player's events, such as playback errors or status updates, rendering of the first audio and video frame, and resolution switching.
69
+ * @notes <br>
70
+ * Call this method before calling play {@link #play}.
71
+ * @param observer The player observer. See VeLivePlayerObserver {@link #VeLivePlayerObserver} for details.
72
+ * @order 2
73
+ */
74
+ setObserver(observer: VeLivePlayerObserver): void;
75
+
76
+ /** {en}
77
+ * @detail api
78
+ * @brief Sets the fill mode of the player screen.
79
+ * @notes <br>
80
+ * - Call this method before calling [play](#VeLivePlayer-play) to set the initial fill mode of the player.
81
+ * - You can call this method during playback to dynamically adjust the fill mode.
82
+ * @order 3
83
+ * @param fillMode The fill mode of SurfaceView. The default value is `VeLivePlayerFillModeAspectFill`. For details, see VeLivePlayerFillMode {@link #VeLivePlayerFillMode}.
84
+ */
85
+ setRenderFillMode(fillMode: VeLivePlayerFillMode): Promise<void>;
86
+
87
+ /** {en}
88
+ * @platform android
89
+ * @detail api
90
+ * @brief Sets the `SurfaceHolder` object for video rendering and playback. Use this method if you use `SurfaceView` for playback.
91
+ * @notes <br>
92
+ * If you call both `setSurfaceHolder` and setSurface {@link #setSurface} to set the `Surface` object, the player will prioritize the configurations of `surfaceHolder`.
93
+ * @param surfaceHolder The `SurfaceHolder` object.
94
+ * @order 6
95
+ */
96
+ android_setSurfaceHolder(surfaceHolder: any): void;
97
+
98
+ /** {en}
99
+ * @platform android
100
+ * @detail api
101
+ * @brief Sets the `Surface` object for video rendering and playback. Use this method if you use `SurfaceView` or `TextureView` for playback.
102
+ * @notes <br>
103
+ * If you call both setSurfaceHolder {@link #setSurfaceHolder} and `setSurface` to set the `Surface` object, the player will prioritize the configurations of `surfaceHolder`.
104
+ * @param surface The `Surface` object.
105
+ * @order 7
106
+ */
107
+ android_setSurface(surface: any): void;
108
+
109
+ /** {en}
110
+ * @detail api
111
+ * @brief Sets a pull stream address.
112
+ * @notes <br>Call this method before calling play.
113
+ * @order 8
114
+ * @param url The pull stream address.
115
+ */
116
+ setPlayUrl(url: string): void;
117
+
118
+ /** {en}
119
+ * @detail api
120
+ * @brief Sets multiple live streams. Call this method if you need to enable features requiring multiple live streams, such as adaptive bitrate (ABR), manual resolution switching, and primary and backup streams.
121
+ * @notes <br>Call this method before calling play.
122
+ * @order 8
123
+ * @param streamData Configurations for multiple pull stream addresses. For details, see VeLivePlayerStreamData {@link #VeLivePlayerStreamData}.
124
+ */
125
+ setPlayStreamData(streamData: VeLivePlayerStreamData): void;
126
+
127
+ /** {en}
128
+ * @detail api
129
+ * @brief Starts or resumes playback.
130
+ * @notes <br>
131
+ * After you call this method, the onPlayerStatusUpdate {@link #VeLivePlayerObserver #onPlayerStatusUpdate} callback is triggered both when the player finishes preparing for stream pulling and when the first frame is rendered.
132
+ * @order 8
133
+ */
134
+ play(): Promise<void>;
135
+
136
+ /** {en}
137
+ * @detail api
138
+ * @brief Pauses playback.
139
+ * @notes <br>
140
+ * When playback is paused after you call this method, the onPlayerStatusUpdate {@link #VeLivePlayerObserver #onPlayerStatusUpdate} callback is triggered.
141
+ * @order 8
142
+ */
143
+ pause(): Promise<void>;
144
+
145
+ /** {en}
146
+ * @detail api
147
+ * @brief Stops playback. This method does not destroy the player.
148
+ * @notes <br>
149
+ * When playback stops after you call this method, the onPlayerStatusUpdate {@link #VeLivePlayerObserver #onPlayerStatusUpdate} callback is triggered.
150
+ * @order 8
151
+ */
152
+ stop(): Promise<void>;
153
+
154
+ /** {en}
155
+ * @detail api
156
+ * @brief Stops playback and destroys the player.
157
+ * @order 8
158
+ */
159
+ destroy(): void;
160
+
161
+ /** {en}
162
+ * @detail api
163
+ * @brief Changes the video resolution.
164
+ * @notes - Call [setPlayStreamData](#VeLivePlayer-setplaystreamdata) to set multiple resolutions before calling this method.
165
+ * - Once the player switches to the new resolution after you call this method, the [onResolutionSwitch](player-android-api-callback#VeLivePlayerObserver-onresolutionswitch) callback is triggered.
166
+ * @return <br>
167
+ * - true: Success;
168
+ * - false: Failure.
169
+ * @order 8
170
+ * @param resolution The video resolution. For details, refer to VeLivePlayerResolution {@link #VeLivePlayerResolution}.
171
+ */
172
+ switchResolution(resolution: VeLivePlayerResolution): void;
173
+
174
+ /** {en}
175
+ * @detail api
176
+ * @brief Checks whether the player is playing.
177
+ * @return Whether the player is playing. <br>
178
+ * - true: The player is playing;
179
+ * - false: The player is not playing.
180
+ * @order 8
181
+ */
182
+ isPlaying(): boolean;
183
+
184
+ /** {en}
185
+ * @detail api
186
+ * @brief Sets the player volume.
187
+ * @param volume The volume. The default value is `1.0`. The value range is [0.0, 1.0].
188
+ * @order 8
189
+ */
190
+ setPlayerVolume(volume: number): void;
191
+
192
+ /** {en}
193
+ * @detail api
194
+ * @brief Sets whether to mute playback.
195
+ * @param mute Whether to mute playback. The default value is `false`. <br>
196
+ * - true: Mute;
197
+ * - false: Do not mute.
198
+ * @order 9
199
+ */
200
+ setMute(mute: boolean): void;
201
+
202
+ /** {en}
203
+ * @detail api
204
+ * @brief Checks whether playback is muted.
205
+ * @return Whether playback is muted. <br>
206
+ * - true: Muted;
207
+ * - false: Not muted.
208
+ * @order 10
209
+ */
210
+ isMute(): boolean;
211
+
212
+ /** {en}
213
+ * @detail api
214
+ * @brief Sets the mapping of domain names to server IP addresses.
215
+ * @param hostIpMap The mapping of domain names to server IP addresses. The `Map` object uses the domain name as the key, and the corresponding value is a list of IP addresses for the servers associated with that domain. The value is of the `List` type.
216
+ * @order 11
217
+ */
218
+ setUrlHostIP(hostIpMap: Record<string, Array<string>>): void;
219
+
220
+ /** {en}
221
+ * @detail api
222
+ * @brief Configures advanced settings for the player, including offscreen rendering, maximum buffer duration, and adaptive bitrate (ABR) algorithms. Contact BytePlus technical support if you need further information.
223
+ * @param key The parameter name of the advanced setting.
224
+ * @param value The parameter value of the advanced setting.
225
+ * @order 12
226
+ */
227
+ setProperty(key: string, value: Object): void;
228
+
229
+ /** {en}
230
+ * @detail api
231
+ * @brief Takes a screenshot of the video.
232
+ * @notes <br>
233
+ * - This method only takes effect during playback.
234
+ * - When a screenshot is captured after you call this method, the onSnapshotComplete {@link #VeLivePlayerObserver #onSnapshotComplete} callback is triggered containing the Bitmap object of the screenshot.
235
+ * @return <br>
236
+ * - 0: Screenshot capturing is allowed.
237
+ * - [VeLivePlayerErrorRefused](player-android-api-errorcode#VeLivePlayerErrorCode-veliveplayererrorrefused) : Screenshot capturing is not allowed.
238
+ * @order 13
239
+ */
240
+ snapshot(): number;
241
+
242
+ /** {en}
243
+ * @detail api
244
+ * @brief Sets the video frame observer.
245
+ * @param enable Whether to enable the video frame callback. The default value is `false`. <br>
246
+ * - true: Enable;
247
+ * - false: Disable.
248
+ * @param pixelFormat The pixel format of the video frame in the callback. See VeLivePlayerPixelFormat {@link #VeLivePlayerPixelFormat} for details.
249
+ * @param bufferType The encapsulation format of the video data in the callback. For details, see VeLivePlayerVideoBufferType {@link #VeLivePlayerVideoBufferType}.
250
+ * @notes <br>
251
+ * - You can call this method to subscribe to decoded video data for external rendering.
252
+ * - After you call this method, the onRenderVideoFrame {@link #VeLivePlayerObserver #onRenderVideoFrame} callback is triggered once the SDK receives a video frame. The callback contains detailed information about the video frame.
253
+ * - If you use external rendering, you need to make sure the video and audio are synchronized.
254
+ * @order 14
255
+ */
256
+ enableVideoFrameObserver(enable: boolean, pixelFormat: VeLivePlayerPixelFormat, bufferType: VeLivePlayerVideoBufferType): void;
257
+
258
+ /** {en}
259
+ * @detail api
260
+ * @brief Sets the audio frame observer.
261
+ * @notes
262
+ * - You can call this method to subscribe to decoded audio data if you want to use external rendering.
263
+ * - After you call this method, the [onRenderAudioFrame](player-android-api-callback#VeLivePlayerObserver-onrenderaudioframe) callback is triggered once the SDK receives an audio frame. The callback contains detailed information about the audio frame.
264
+ * - If you use external rendering, you need to make sure the video and audio are synchronized.
265
+ * @order 15
266
+ * @param enable Whether to enable the audio frame callback. The default value is `false`. <br>
267
+ * - true: Enable;
268
+ * - false: Disable.
269
+ * @param enableRendering Whether to enable player rendering. The default value is `false`. <br>
270
+ * - true: Enable;
271
+ * - false: Disable.
272
+ */
273
+ enableAudioFrameObserver(enable: boolean, enableRendering: boolean): void;
274
+
275
+ /** {en}
276
+ * @detail api
277
+ * @brief Sets the clockwise rotation angle of the video.
278
+ * @param rotation The clockwise rotation angle of the video. Rotation is disabled by default. See VeLivePlayerRotation {@link #VeLivePlayerRotation} for details.
279
+ * @notes <br>
280
+ * - You can change the rotation angle before and during playback.
281
+ * - Each time this method is called, the player rotates the video based on the original video.
282
+ * - When you apply both rotation and mirroring to the video, the player will mirror the video and then rotate it.
283
+ * @order 16
284
+ */
285
+ setRenderRotation(rotation: VeLivePlayerRotation): Promise<void>;
286
+
287
+ /** {en}
288
+ * @detail api
289
+ * @brief Configures mirroring settings.
290
+ * @param mirror Mirroring settings. Mirroring is disabled by default. See VeLivePlayerMirror {@link #VeLivePlayerMirror} for details.
291
+ * @notes <br>
292
+ * - You can change the mirroring settings before and during playback.
293
+ * - Each time this method is called, the player applies the mirroring settings to the original video.
294
+ * - When you apply both rotation and mirroring to the video, the player will mirror the video and then rotate it.
295
+ * @order 17
296
+ */
297
+ setRenderMirror(mirror: VeLivePlayerMirror): Promise<void>;
298
+
299
+ /** {en}
300
+ * @detail api
301
+ * @brief Enables or disables super resolution. You must first contact the BytePlus [technical support](https://www.byteplus.com/en/support) to activate the feature before using it.
302
+ * @param enable Whether to enable super resolution.
303
+ * @notes
304
+ * - Call this method after receiving the {@link #VeLivePlayerObserver#onFirstVideoFrameRender onFirstVideoFrameRender} callback, or during playback.
305
+ * - If the SDK fails to enable super resolution due to device model, video resolution or frame rate, you will receive the {@link #VeLivePlayerObserver#onStreamFailedOpenSuperResolution onStreamFailedOpenSuperResolution} callback.
306
+ * @order 18
307
+ */
308
+ setEnableSuperResolution(enable: boolean): void;
309
+
310
+ /** {en}
311
+ * @platform android
312
+ * @brief Set whether to enable video sharpening.
313
+ * @param enable Set whether to enable video sharpening. The default value is `false`.
314
+ * - true: Enable;
315
+ * - false: Disable.
316
+ */
317
+ android_setEnableSharpen(enable: boolean): void;
318
+
319
+ /** {en}
320
+ * @platform ios
321
+ * @brief Initializes the specified type of player.
322
+ * @param type The player type. Refer to [VeLivePlayerType](player-sdk-for-ios-api#VeLivePlayerType) for details.
323
+ */
324
+ ios_initWithType(type: VeLivePlayerType): this;
325
+
326
+ /** {en}
327
+ * @platform ios
328
+ * @hidden (iOS)
329
+ * @param item
330
+ */
331
+ ios_prepare(item: $p_i.TVLManager): void;
332
+ }
333
+
334
+ /** {en}
335
+ * @platform ios
336
+ * @brief Player Type.
337
+ */
338
+ export declare enum VeLivePlayerType {
339
+
340
+ /** {en}
341
+ * @platform ios
342
+ * @brief Custom player.
343
+ */
344
+ VeLivePlayerTypeOwn = 0,
345
+
346
+ /** {en}
347
+ * @platform ios
348
+ * @brief System player.
349
+ */
350
+ VeLivePlayerTypeSystem = 1
351
+ }
352
+ export declare class t_VeLivePlayerType {
353
+ static ts_to_android(value: VeLivePlayerType): never;
354
+ static android_to_ts(value: unknown): never;
355
+ static ts_to_ios(value: VeLivePlayerType): $p_i.VeLivePlayerType;
356
+ static ios_to_ts(value: $p_i.VeLivePlayerType): VeLivePlayerType;
357
+ }
358
+ /**
359
+ * @platform ios
360
+ * 直播特效模型类型
361
+ */
362
+ export declare enum VeLivePlayerEffectType {
363
+
364
+ /** {en}
365
+ * @platform ios
366
+ * @hidden (iOS)
367
+ */
368
+ VeLivePlayerEffectUnknown = 0,
369
+
370
+ /** {en}
371
+ * @platform ios
372
+ * @hidden (iOS)
373
+ */
374
+ VeLivePlayerEffectAudioBalance = 1
375
+ }
376
+ export declare class t_VeLivePlayerEffectType {
377
+ static ts_to_android(value: VeLivePlayerEffectType): never;
378
+ static android_to_ts(value: unknown): never;
379
+ static ts_to_ios(value: VeLivePlayerEffectType): $p_i.VeLivePlayerEffectType;
380
+ static ios_to_ts(value: $p_i.VeLivePlayerEffectType): VeLivePlayerEffectType;
381
+ }