import { ComponentType } from 'react' import { StandardProps, CommonEventFunction } from './common' interface AudioProps extends StandardProps { /** audio 组件的唯一标识符 * @supported weapp */ id?: string /** 要播放音频的资源地址 * @supported weapp, h5, swan */ src?: string /** 是否循环播放 * @default false * @supported weapp, h5, swan */ loop?: boolean /** 是否静音播放 * @default false * @supported h5 * @deprecated */ muted?: boolean /** 是否显示默认控件 * @default false * @supported weapp, h5, swan */ controls?: boolean /** 默认控件上的音频封面的图片资源地址,如果 controls 属性值为 false 则设置 poster 无效 * @supported weapp, swan */ poster?: string /** 默认控件上的音频名字,如果 controls 属性值为 false 则设置 name 无效 * @default "未知音频" * @supported weapp */ name?: string /** 默认控件上的作者名字,如果 controls 属性值为 false 则设置 author 无效 * @default "未知作者" * @supported weapp */ author?: string /** 当发生错误时触发 error 事件,detail = {errMsg: MediaError.code} * @supported weapp, h5, swan */ onError?: CommonEventFunction /** 当开始/继续播放时触发play事件 * @supported weapp, h5, swan */ onPlay?: CommonEventFunction /** 当暂停播放时触发 pause 事件 * @supported weapp, h5, swan */ onPause?: CommonEventFunction /** 当播放进度改变时触发 timeupdate 事件,detail = {currentTime, duration} * @supported weapp, h5, swan */ onTimeUpdate?: CommonEventFunction /** 当播放到末尾时触发 ended 事件 * @supported weapp, h5, swan */ onEnded?: CommonEventFunction /** 用于透传 `WebComponents` 上的属性到内部 H5 标签上 * @supported h5 */ nativeProps?: Record } declare namespace AudioProps { interface onErrorEventDetail { errMsg: keyof MediaError.Code } interface onTimeUpdateEventDetail { /** 当前时间 */ currentTime: number /** 持续时间 */ duration: number } namespace MediaError { interface Code { /** 获取资源被用户禁止 */ 1 /** 网络错误 */ 2 /** 解码错误 */ 3 /** 不合适资源 */ 4 } } } /** 音频。1.6.0版本开始,该组件不再维护。建议使用能力更强的 Taro.createInnerAudioContext 接口 * @classification media * @deprecated * @supported weapp, h5, swan * @example_react * ```tsx * export default class PageView extends Component { * constructor() { * super(...arguments) * } * * render() { * return ( * * * ) * } * } * ``` * @example_vue * ```html * * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/component/audio.html */ declare const Audio: ComponentType export { Audio, AudioProps }