import { VeLivePlayer } from './api';
import { VeLivePlayerError } from './errorcode';
import { long, int, String, Bitmap } from './types';
import { VeLivePlayerResolution, VeLivePlayerResolutionSwitchReason, VeLivePlayerStreamType, VeLivePlayerStatus, VeLivePlayerStatistics, VeLivePlayerVideoFrame, VeLivePlayerAudioFrame } from './keytype';
export declare class VeLivePlayerObserver {
/** {en}
* @detail callback
* @brief Occurs when a player error occurs.
* @param player The player object that triggers the callback function.
* @param error The error message. Refer to VeLivePlayerError{@link #VeLivePlayerError} for details.
* @order 1
*
*/
onError?(player: VeLivePlayer, error: VeLivePlayerError): void;
/** {en}
* @detail callback
* @brief Occurs when the first video frame is rendered at the beginning of playback or after a retry during playback.
* @param player The player object that triggers the callback function.
* @param isFirstFrame Whether the video frame is the first video frame rendered at the beginning of playback.
* - true: The video frame is the first video frame rendered at the beginning of playback;
* - false: The video frame is the first video frame rendered after a retry during playback.
* @order 2
*
*/
onFirstVideoFrameRender?(player: VeLivePlayer, isFirstFrame: boolean): void;
/** {en}
* @detail callback
* @brief Occurs when the first audio frame is rendered at the beginning of playback or after a retry during playback.
* @param player The player object that triggers the callback function.
* @param isFirstFrame Whether the audio frame is the first audio frame rendered at the beginning of playback.
* - true: The audio frame is the first audio frame rendered at the beginning of playback;
* - false: The audio frame is the first audio frame rendered after a retry during playback.
* @order 3
*
*/
onFirstAudioFrameRender?(player: VeLivePlayer, isFirstFrame: boolean): void;
/** {en}
* @detail callback
* @brief Occurs when a playback stutter starts.
* @param player The player object that triggers the callback function.
* @order 4
*
*/
onStallStart?(player: VeLivePlayer): void;
/** {en}
* @detail callback
* @brief Occurs when a playback stutter stops, that is, when playback resumes after there is enough audio buffer.
* @param player The player object that triggers the callback function.
* @order 5
*
*/
onStallEnd?(player: VeLivePlayer): void;
/** {en}
* @detail callback
* @brief Occurs when video rendering stutters.
* @param player The player object that triggers the callback function.
* @param stallTime The stutter duration, in milliseconds.
* @order 6
*
*/
onVideoRenderStall?(player: VeLivePlayer, stallTime: long): void;
/** {en}
* @detail callback
* @brief Occurs when audio rendering stutters.
* @param player The player object that triggers the callback function.
* @param stallTime The stutter duration, in milliseconds.
* @order 7
*
*/
onAudioRenderStall?(player: VeLivePlayer, stallTime: long): void;
/** {en}
* @detail callback
* @brief Occurs when the video resolution changes.
* @param player The player object that triggers the callback function.
* @param resolution The updated resolution. See [VeLivePlayerResolution](docs-player-android-api-keytype#VeLivePlayerResolution) for details.
* @param error Whether an error occurred during resolution switching. See VeLivePlayerError{@link #VeLivePlayerError} for details.
* @param reason The reason for resolution switching. See VeLivePlayerResolutionSwitchReason{@link #VeLivePlayerResolutionSwitchReason} for details.
* @order 8
*
*/
onResolutionSwitch?(player: VeLivePlayer, resolution: VeLivePlayerResolution, error: VeLivePlayerError, reason: VeLivePlayerResolutionSwitchReason): void;
/** {en}
* @detail callback
* @brief Occurs when the video size changes.
* @param player The player object that triggers the callback function.
* @param width The updated width of the video, in pixels.
* @param height The updated height of the video, in pixels.
* @order 9
*
*/
onVideoSizeChanged?(player: VeLivePlayer, width: int, height: int): void;
/** {en}
* @detail callback
* @brief String SEI message callback. This callback is triggered when the player SDK receives an SEI message. It is necessary to enable the `enableSei` property in `VeLivePlayerConfiguration`. When the `enableBinarySei` property is enabled, the string SEI message will no longer be sent.
* @param player The player object that triggers the callback function.
* @param message The SEI message.
* @order 10
*
*/
onReceiveSeiMessage?(player: VeLivePlayer, message: String): void;
/** {en}
* @detail callback
* @brief Binary SEI message callback. This callback is triggered when the player SDK receives an SEI message. It is necessary to enable the `enableBinarySei` property in `VeLivePlayerConfiguration`. When the `enableBinarySei` property is enabled, the string SEI message will no longer be sent.
* @param player The player object that triggers the callback function.
* @param message The SEI message.
* @order 10
*
*/
onReceiveBinarySeiMessage?(player: VeLivePlayer, message: ArrayBuffer): void;
/** {en}
* @detail callback
* @brief Occurs when the player switches between the primary stream and the backup stream.
* @param player The player object that triggers the callback function.
* @param streamType The type of the updated stream. For details, see VeLivePlayerStreamType{@link #VeLivePlayerStreamType}.
* @param error The reason for the switch. For details, see VeLivePlayerError{@link #VeLivePlayerError}.
* @order 11
*
*/
onMainBackupSwitch?(player: VeLivePlayer, streamType: VeLivePlayerStreamType, error: VeLivePlayerError): void;
/** {en}
* @detail callback
* @brief Occurs when the playback status changes.
* @param player The player object that triggers the callback function.
* @param status The updated status of the player. See VeLivePlayerStatus{@link #VeLivePlayerStatus} for details.
* @order 12
*
*/
onPlayerStatusUpdate?(player: VeLivePlayer, status: VeLivePlayerStatus): void;
/** {en}
* @detail callback
* @brief Occurs periodically to report information such as the current pull stream address, bitrate, and frame rate.
* @param player The player object that triggers the callback function.
* @param statistics The playback statistics. For details, see VeLivePlayerStatistics{@link #VeLivePlayerStatistics}.
* @order 13
*
*/
onStatistics?(player: VeLivePlayer, statistics: VeLivePlayerStatistics): void;
/** {en}
* @detail callback
* @brief Occurs when a screenshot is taken after snapshot{@link #VeLivePlayer#snapshot} is called.
* @param player The player object that triggers the callback function.
* @param bitmap The Bitmap object of the screenshot.
* @order 14
*
*/
onSnapshotComplete?(player: VeLivePlayer, bitmap: Bitmap): void;
/** {en}
* @detail callback
* @brief Occurs when the player decodes a video frame. Call [enableVideoFrameObserver](docs-player-android-api-reference#VeLivePlayer-enablevideoframeobserver) to enable video frame callback.
* @notes
* If you use the texture format for external rendering, we recommend that you render the video in the callback thread.
* @order 15
* @param player The player object that triggers the callback function.
* @param videoFrame The video frame, including the pixel format, encapsulation format, width and height of the video, and other information. See VeLivePlayerVideoFrame{@link #VeLivePlayerVideoFrame} for details.
*
*/
onRenderVideoFrame?(player: VeLivePlayer, videoFrame: VeLivePlayerVideoFrame): void;
/** {en}
* @detail callback
* @brief Occurs when the player decodes an audio frame. Call enableAudioFrameObserver{@link #VeLivePlayer#enableAudioFrameObserver} to enable audio frame callback.
* @param player The player object that triggers the callback function.
* @param audioFrame The audio frame. See VeLivePlayerAudioFrame{@link #VeLivePlayerAudioFrame} for details.
* @notes
* The audio data returned by the callback is of type Float32 and in big-endian byte order.
* @order 16
*
*/
onRenderAudioFrame?(player: VeLivePlayer, audioFrame: VeLivePlayerAudioFrame): void;
/** {en}
* @detail callback
* @brief Occurs when the SDK fails to enable super resolution after setEnableSuperResolution{@link #VeLivePlayer#setEnableSuperResolution} is called.
* @order 17
* @param player The player object that triggers the callback function.
* @param error The reason of the failure. See [VeLivePlayerErrorCode](docs-player-android-api-errorcode#VeLivePlayerErrorCode) for details.
*
*/
onStreamFailedOpenSuperResolution?(player: VeLivePlayer, error: VeLivePlayerError): void;
/** {en}
* @detail callback
* @brief Occurs when the SDK fails to enable sharpen after [setEnableSuperResolution](docs-player-android-api-reference#VeLivePlayer-setenablesuperresolution) is called.
* @param player The player object that triggers the callback function.
* @param error The reason of the failure. See [VeLivePlayerErrorCode](docs-player-android-api-errorcode#VeLivePlayerErrorCode) for details.
* @order 18
*
*/
onStreamFailedOpenSharpen?(player: VeLivePlayer, error: VeLivePlayerError): void;
}