import { TVLManager } from './api';
import { VeLivePlayerError } from './errorcode';
import { BOOL, int64_t, int, NSString, NSData, UIImage } 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. See VeLivePlayerError{@link #VeLivePlayerError} for details.
* @order 1
*/
onError$error?(player: TVLManager, 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.
* - YES: The video frame is the first video frame rendered at the beginning of playback;
* - NO: The video frame is the first video frame rendered after a retry during playback.
* @order 2
*/
onFirstVideoFrameRender$isFirstFrame?(player: TVLManager, isFirstFrame: BOOL): 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.
* - YES: The audio frame is the first audio frame rendered at the beginning of playback;
* - NO: The audio frame is the first audio frame rendered after a retry during playback.
*/
onFirstAudioFrameRender$isFirstFrame?(player: TVLManager, isFirstFrame: BOOL): void;
/** {en}
* @detail callback
* @brief Occurs when a playback stutter starts.
* @param player The player object that triggers the callback function.
* @order 3
*
*/
onStallStart?(player: TVLManager): 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 4
*/
onStallEnd?(player: TVLManager): 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.
*/
onVideoRenderStall$stallTime?(player: TVLManager, stallTime: int64_t): 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.
*/
onAudioRenderStall$stallTime?(player: TVLManager, stallTime: int64_t): 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{@link #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 5
*/
onResolutionSwitch$resolution$error$reason?(player: TVLManager, 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 6
*/
onVideoSizeChanged$width$height?(player: TVLManager, width: int, height: int): void;
/** {en}
* @detail api
* @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 7
*/
onReceiveSeiMessage$message?(player: TVLManager, message: NSString): void;
/** {en}
* @detail api
* @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 7
*/
onReceiveBinarySeiMessage$message?(player: TVLManager, message: NSData): 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. See VeLivePlayerStreamType{@link #VeLivePlayerStreamType} for details.
* @param error The reason for the switch. See VeLivePlayerError{@link #VeLivePlayerError} for details.
* @order 8
*/
onMainBackupSwitch$streamType$error?(player: TVLManager, 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 9
*/
onPlayerStatusUpdate$status?(player: TVLManager, 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. See VeLivePlayerStatistics{@link #VeLivePlayerStatistics} for details.
* @order 10
*/
onStatistics$statistics?(player: TVLManager, 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 image The UIImage object of the screenshot.
* @order 11
*/
onSnapshotComplete$image?(player: TVLManager, image: UIImage): void;
/** {en}
* @detail callback
* @brief Occurs when the player decodes a video frame. Call [enableVideoFrameObserver:pixelFormat:bufferType:](docs-player-sdk-for-ios-api#TVLManager(VeLivePlayer)-enablevideoframeobserver-pixelformat-buffertype) 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 12
* @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$videoFrame?(player: TVLManager, videoFrame: VeLivePlayerVideoFrame): void;
/** {en}
* @detail callback
* @brief Occurs when the player decodes an audio frame. Call [enableAudioFrameObserver:enableRendering:](docs-player-sdk-for-ios-api#TVLManager(VeLivePlayer)-enableaudioframeobserver-enablerendering) to enable audio frame callback.
* @notes
* The audio data returned by the callback is of type Float32 and in big-endian byte order.
* @order 13
* @param player The player object that triggers the callback function.
* @param audioFrame The audio frame. See VeLivePlayerAudioFrame{@link #VeLivePlayerAudioFrame} for details.
*/
onRenderAudioFrame$audioFrame?(player: TVLManager, audioFrame: VeLivePlayerAudioFrame): void;
/** {en}
* @detail callback
* @brief Occurs when the SDK fails to enable super resolution after [setEnableSuperResolution:](docs-player-sdk-for-ios-api#TVLManager(VeLivePlayer)-setenablesuperresolution) is called.
* @order 14
* @param player The player object that triggers the callback function.
* @param error The reason of the failure. See VeLivePlayerErrorCode{@link #VeLivePlayerErrorCode} for details.
*/
onStreamFailedOpenSuperResolution$error?(player: TVLManager, error: VeLivePlayerError): void;
}