import { String, SurfaceHolder, Surface, float, Map, List, int } from './types'; import { VeLivePlayerLogLevel, VeLivePlayerConfiguration, VeLivePlayerFillMode, VeLivePlayerStreamData, VeLivePlayerResolution, VeLivePlayerPixelFormat, VeLivePlayerVideoBufferType, VeLivePlayerAudioBufferType, VeLivePlayerRotation, VeLivePlayerMirror } from './keytype'; import { VeLivePlayerObserver } from './callback'; import { ApplicationContext } from './external'; export declare class VeLivePlayer { /** {en} * @detail api * @brief Gets the version number of the Player SDK. * @return
* The version number of the Player SDK. * @order 4 * */ static getVersion(): String; /** {en} * @detail api * @brief Sets the level of the output log. * @param logLevel The level of the output log. For details, see VeLivePlayerLogLevel{@link #VeLivePlayerLogLevel}. * @order 5 * */ static setLogLevel(logLevel: VeLivePlayerLogLevel): void; constructor(context: ApplicationContext); /** {en} * @detail api * @brief Initializes the player and configures whether to turn on SEI messaging, hardware decoding, local DNS prefetch, and other configurations. * @notes
Call this method to initialize the player before calling [play](#VeLivePlayer-play) . * @order 1 * @param config Player configurations. Refer to VeLivePlayerConfiguration{@link #VeLivePlayerConfiguration} for details. * */ setConfig(config: VeLivePlayerConfiguration): void; /** {en} * @detail api * @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. * @notes * Call this method before calling [play](#VeLivePlayer-play). * @param observer The player observer. See VeLivePlayerObserver{@link #VeLivePlayerObserver} for details. * @order 2 * */ setObserver(observer: VeLivePlayerObserver): void; /** {en} * @detail api * @brief Sets the fill mode of the player screen. * @notes
* - Call this method before calling [play](#VeLivePlayer-play) to set the initial fill mode of the player. * - You can call this method during playback to dynamically adjust the fill mode. * @order 3 * @param fillMode The fill mode of SurfaceView. The default value is `VeLivePlayerFillModeAspectFill`. For details, see VeLivePlayerFillMode{@link #VeLivePlayerFillMode}. * */ setRenderFillMode(fillMode: VeLivePlayerFillMode): Promise; /** {en} * @detail api * @brief Sets the `SurfaceHolder` object for video rendering and playback. Use this method if you use `SurfaceView` for playback. * @notes * If you call both setSurfaceHolder and [setSurface](#VeLivePlayer-setsurface) to set the `Surface` object, the player will prioritize the configurations of `surfaceHolder`. * @param surfaceHolder The `SurfaceHolder` object. * @order 6 * */ setSurfaceHolder(surfaceHolder: SurfaceHolder): void; /** {en} * @detail api * @brief Sets the `Surface` object for video rendering and playback. Use this method if you use `SurfaceView` or `TextureView` for playback. * @notes * If you call both [setSurfaceHolder](#VeLivePlayer-setsurfaceholder) and `setSurface` to set the `Surface` object, the player will prioritize the configurations of `surfaceHolder`. * @param surface The `Surface` object. * @order 7 * */ setSurface(surface: Surface): void; /** {en} * @detail api * @brief Sets a pull stream address. * @notes
Call this method before calling play. * @order 8 * @param url The pull stream address. * */ setPlayUrl(url: String): void; /** {en} * @detail api * @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. * @notes
Call this method before calling play. * @order 8 * @param streamData Configurations for multiple pull stream addresses. For details, see [VeLivePlayerStreamData](player-android-api-keytype#VeLivePlayerStreamData). * */ setPlayStreamData(streamData: VeLivePlayerStreamData): void; /** {en} * @detail api * @brief Starts or resumes playback. * @notes * After you call this method, the [onPlayerStatusUpdate](docs-player-android-api-callback#VeLivePlayerObserver-onplayerstatusupdate) callback is triggered both when the player finishes preparing for stream pulling and when the first frame is rendered. * @order 8 * */ play(): void; /** {en} * @detail api * @brief Pauses playback. * @notes * When playback is paused after you call this method, the [onPlayerStatusUpdate](docs-player-android-api-callback#VeLivePlayerObserver-onplayerstatusupdate) callback is triggered. * @order 8 * */ pause(): void; /** {en} * @detail api * @brief Stops playback. This method does not destroy the player. * @notes * When playback stops after you call this method, the [onPlayerStatusUpdate](docs-player-android-api-callback#VeLivePlayerObserver-onplayerstatusupdate) callback is triggered. * @order 8 * */ stop(): void; /** {en} * @detail api * @brief Stops playback and destroys the player. * @order 8 * */ destroy(): void; /** {en} * @detail api * @brief Changes the video resolution. * @notes - Call [setPlayStreamData](#VeLivePlayer-setplaystreamdata) to set multiple resolutions before calling this method. * - Once the player switches to the new resolution after you call this method, the [onResolutionSwitch](docs-player-android-api-callback#VeLivePlayerObserver-onresolutionswitch) callback is triggered. * @order 8 * @param resolution The video resolution. For details, refer to VeLivePlayerResolution * @return
* - true: Success; * - false: Failure. * */ switchResolution(resolution: VeLivePlayerResolution): boolean; /** {en} * @detail api * @brief Checks whether the player is playing. * @return Whether the player is playing.
* - true: The player is playing; * - false: The player is not playing. * @order 8 * */ isPlaying(): boolean; /** {en} * @detail api * @brief Sets the player volume. * @param volume The volume. The default value is `1.0`. The value range is [0.0, 1.0]. * @order 8 * */ setPlayerVolume(volume: float): void; /** {en} * @detail api * @brief Sets whether to mute playback. * @param mute Whether to mute playback. The default value is `false`.
* - true: Mute; * - false: Do not mute. * @order 9 * */ setMute(mute: boolean): void; /** {en} * @detail api * @brief Checks whether playback is muted. * @return Whether playback is muted.
* - true: Muted; * - false: Not muted. * @order 10 * */ isMute(): boolean; /** {en} * @detail api * @brief Sets the mapping of domain names to server IP addresses. * @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. * @order 11 * @notes - When using setUrlHostIP to map domain names and IP addresses, disable the DNS pre-resolution feature in the initial configuration by setting [enableLiveDNS](docs-player-android-api-keytype#VeLivePlayerConfiguration-enablelivedns) to false. * - Call this method to set the mapping of domain names and IP addresses before calling [play](#VeLivePlayer-play) to start playback. * */ setUrlHostIP(hostIpMap: Map>): void; /** {en} * @detail api * @brief Configures advanced settings for the player, including offscreen rendering, maximum buffer duration, and adaptive bitrate (ABR) algorithms. [Create a ticket](https://console.byteplus.com/workorder/create?step=2&SubProductID=P00000980) to contact BytePlus technical support if you need further information. * @param key The parameter name of the advanced setting. * @param value The parameter value of the advanced setting. * @order 12 * */ setProperty(key: String, value: Object): void; /** {en} * @detail api * @brief Takes a screenshot of the video. * @notes * - This method only takes effect during playback. * - When a screenshot is captured after you call this method, the [onSnapshotComplete](docs-player-android-api-callback#VeLivePlayerObserver-onsnapshotcomplete) callback is triggered containing the Bitmap object of the screenshot. * @order 13 * @return * - 0: Screenshot capturing is allowed. * - [VeLivePlayerErrorRefused](docs-player-android-api-errorcode#VeLivePlayerErrorCode-veliveplayererrorrefused) : Screenshot capturing is not allowed. * */ snapshot(): int; /** {en} * @detail api * @brief Sets the video frame observer. * @param enable Whether to enable the video frame callback. The default value is `false`.
* - true: Enable; * - false: Disable. * @param pixelFormat The pixel format of the video frame in the callback. See VeLivePlayerPixelFormat{@link #VeLivePlayerPixelFormat} for details. * @param bufferType The encapsulation format of the video data in the callback. For details, see VeLivePlayerVideoBufferType{@link #VeLivePlayerVideoBufferType}. * @notes * - You can call this method to subscribe to decoded video data for external rendering. * - After you call this method, the [onRenderVideoFrame](docs-player-android-api-callback#VeLivePlayerObserver-onrendervideoframe) callback is triggered once the SDK receives a video frame. The callback contains detailed information about the video frame. * - If you use external rendering, you need to make sure the video and audio are synchronized. * @order 14 * */ enableVideoFrameObserver(enable: boolean, pixelFormat: VeLivePlayerPixelFormat, bufferType: VeLivePlayerVideoBufferType): void; /** {en} * @detail api * @brief Sets the audio frame observer. * @notes * - You can call this method to subscribe to decoded audio data if you want to use external rendering. * - After you call this method, the [onRenderAudioFrame](docs-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. * - If you use external rendering, you need to make sure the video and audio are synchronized. * @order 15 * * @param enable Whether to enable the audio frame callback. The default value is `false`.
* - true: Enable; * - false: Disable. * @param enableRendering Whether to enable player rendering. The default value is `false`.
* - true: Enable; * - false: Disable. * @param bufferType Audio buffer type. For details, please refer to [VeLivePlayerAudioBufferType](docs-player-android-api-keytype#VeLivePlayerAudioBufferType). * */ enableAudioFrameObserver(enable: boolean, enableRendering: boolean, bufferType: VeLivePlayerAudioBufferType): void; /** {en} * @detail api * @brief Sets the clockwise rotation angle of the video. * @param rotation The clockwise rotation angle of the video. Rotation is disabled by default. See VeLivePlayerRotation{@link #VeLivePlayerRotation} for details. * @notes
* - You can change the rotation angle before and during playback. * - Each time this method is called, the player rotates the video based on the original video. * - When you apply both rotation and mirroring to the video, the player will mirror the video and then rotate it. * @order 16 * */ setRenderRotation(rotation: VeLivePlayerRotation): Promise; /** {en} * @detail api * @brief Configures mirroring settings. * @param mirror Mirroring settings. Mirroring is disabled by default. See VeLivePlayerMirror{@link #VeLivePlayerMirror} for details. * @notes
* - You can change the mirroring settings before and during playback. * - Each time this method is called, the player applies the mirroring settings to the original video. * - When you apply both rotation and mirroring to the video, the player will mirror the video and then rotate it. * @order 17 * */ setRenderMirror(mirror: VeLivePlayerMirror): Promise; /** {en} * @detail api * @brief Enables or disables super resolution. You must first contact BytePlus [technical support](https://console.byteplus.com/workorder/create?step=2&SubProductID=P00000980) to activate the feature before using it. * @param enable Whether to enable super resolution. The default value is false. * - true: enable; * - false: disable. * @notes * - Call this method after receiving the [onFirstVideoFrameRender](docs-player-android-api-callback#VeLivePlayerObserver-onfirstvideoframerender) callback, or during playback. * - Support dynamically enabling and disabling super-resolution by calling this interface during playback. * - If the SDK fails to enable super resolution due to device model, video resolution or frame rate, you will receive the [onStreamFailedOpenSuperResolution](docs-player-android-api-callback#VeLivePlayerObserver-onstreamfailedopensuperresolution) callback. * @order 18 * */ setEnableSuperResolution(enable: boolean): void; /** {en} * @brief Set whether to enable video sharpening. * @param enable Set whether to enable video sharpening. The default value is `false`. * - true: Enable; * - false: Disable. * */ setEnableSharpen(enable: boolean): void; addExtraHttpRequestHeadersByUser(headers: Map): void; }