41 lines
974 B
TypeScript
41 lines
974 B
TypeScript
import type { ForwardRefExoticComponent, RefAttributes } from "react";
|
|
|
|
export interface AliPlayerProps {
|
|
/** 播放地址 */
|
|
source?: string | string[];
|
|
/** 阿里的 vid */
|
|
vid?: string;
|
|
/** 阿里的 playAuth */
|
|
playAuth?: string;
|
|
/** 封面地址 */
|
|
cover?: string;
|
|
/** 播放器宽度,默认 100% */
|
|
width?: string;
|
|
/** 播放器高度,默认 600px */
|
|
height?: string;
|
|
/** 是否自动播放 */
|
|
autoplay?: boolean;
|
|
/** 是否显示进度条 */
|
|
showProgress?: boolean;
|
|
/** 是否直播模式 */
|
|
isLive?: boolean;
|
|
/** 播放开始时间 */
|
|
playTime?: number;
|
|
/** 播放结束事件 */
|
|
onEnded?: () => void;
|
|
/** 播放进度更新事件 */
|
|
onTimeupdate?: (currentTime: number) => void;
|
|
}
|
|
|
|
export interface AliPlayerRef {
|
|
play: () => void;
|
|
pause: () => void;
|
|
}
|
|
|
|
/**
|
|
* 视频播放组件
|
|
*/
|
|
declare const AliPlayer: ForwardRefExoticComponent<AliPlayerProps & RefAttributes<AliPlayerRef>>;
|
|
|
|
export default AliPlayer;
|