import type { NativeSyntheticEvent, View } from 'react-native'; import type React from 'react'; /** * 播放器播放完成 */ export declare type OnCompletionEvent = (e: NativeSyntheticEvent<{}>) => void; /** * 播放器准备完成 * duration 秒 */ export declare type OnPrepareEvent = (e: NativeSyntheticEvent<{ duration: number; }>) => void; /** * 播放器播放失败 */ export declare type OnErrorEvent = (e: NativeSyntheticEvent<{ code: string; message: string; }>) => void; /** * 播放器加载开始事件 */ export declare type OnLoadingBeginEvent = (e: NativeSyntheticEvent<{}>) => void; /** * 播放器加载进度 */ export declare type OnLoadingProgressEvent = (e: NativeSyntheticEvent<{ percent: number; }>) => void; /** * 播放器进度加载完成 */ export declare type OnLoadingEndEvent = (e: NativeSyntheticEvent<{}>) => void; /** * 音轨信息 */ export declare type OnAliBitrateReadyEvent = (e: NativeSyntheticEvent<{ bitrates: [ { index: number; bitrate: number; height: number; width: number; } ]; }>) => void; /** * 首帧渲染 */ export declare type OnRenderingStartEvent = (e: NativeSyntheticEvent<{}>) => void; /** * 拖动完成事件 */ export declare type OnSeekCompleteEvent = (e: NativeSyntheticEvent<{}>) => void; /** * 进度更新事件 * position 位置 */ export declare type onCurrentPositionUpdateEvent = (e: NativeSyntheticEvent<{ position: number; }>) => void; /** * 缓存进度更新 */ export declare type OnBufferedPositionUpdateEvent = (e: NativeSyntheticEvent<{ position: number; }>) => void; /** * 自动播放开始 */ export declare type OnAutoPlayStartEvent = (e: NativeSyntheticEvent<{}>) => void; /** * 循环播放开始 */ export declare type OnLoopingStartEvent = (e: NativeSyntheticEvent<{}>) => void; export declare type BitrateType = { index: number; bitrate: number; height: number; width: number; title?: string; }; export declare type AliVideoViewEvent = Partial<{ onAliCompletion: OnCompletionEvent; onAliError: OnErrorEvent; onAliLoadingBegin: OnLoadingBeginEvent; onAliLoadingProgress: OnLoadingProgressEvent; onAliLoadingEnd: OnLoadingEndEvent; onAliPrepared: OnPrepareEvent; onAliRenderingStart: OnRenderingStartEvent; onAliSeekComplete: OnSeekCompleteEvent; onAliCurrentPositionUpdate: onCurrentPositionUpdateEvent; onAliBufferedPositionUpdate: OnBufferedPositionUpdateEvent; onAliAutoPlayStart: OnAutoPlayStartEvent; onAliLoopingStart: OnLoopingStartEvent; onAliBitrateReady: OnAliBitrateReadyEvent; }>; export declare type AliVideoViewProps = React.ComponentPropsWithRef & { /** 视频播放链接 、支持本地*/ source: { uri?: string; sts?: { vid: string; region: string; securityToken: string; accessKeyId: string; accessKeySecret: string; }; auth?: { vid: string; region: string; playAuth: string; }; }; /** 是否自动播放*/ setAutoPlay?: boolean; /** 是否循环播放*/ setLoop?: boolean; /** 是否静音*/ setMute?: boolean; /** * 是否使用硬解码 */ enableHardwareDecoder?: boolean; /** * 是否启用原生的控制器 */ enableControl?: boolean; /** * 是否后台播放 */ enableBackground?: boolean; /** * 调节声音 */ setVolume?: number; /** * 调节倍速 */ setSpeed?: number; /** * 调节清晰度 */ selectBitrateIndex?: number; /** * 请求referer */ setReferer?: string; /** * 用户头 */ setUserAgent?: string; /** * 渲染镜像模式 * AVP_MIRRORMODE_NONE 0 * AVP_MIRRORMODE_HORIZONTAL 1 * AVP_MIRRORMODE_VERTICAL 2 */ setMirrorMode?: number; /** * 渲染旋转模式 * AVP_ROTATE_0 0 * AVP_ROTATE_90 1 * AVP_ROTATE_180 2 * AVP_ROTATE_270 3 */ setRotateMode?: number; /** * 渲染显示模式 * AVP_SCALINGMODE_SCALETOFILL 0 * 不保持比例平铺 * * AVP_SCALINGMODE_SCALEASPECTFIT 1 * 保持比例,黑边 * * AVP_SCALINGMODE_SCALEASPECTFILL 2 * 保持比例填充,需裁剪 */ setScaleMode?: number; } & AliVideoViewEvent; export declare type AliVideoViewHandleType = { /** * 进度跳转 * @param position */ seekTo: (position: number) => void; /** * 开始播放 */ startPlay: () => void; /** * 暂停播放 */ pausePlay: () => void; /** * 停止播放 */ stopPlay: () => void; /** * 重载播放 */ reloadPlay: () => void; /** * 重头开始播放 */ restartPlay: () => void; /** * 销毁播放器 */ destroyPlay: () => void; };