文档地址:https://help.aliyun.com/zh/vod/developer-reference/basic-features-2?spm=a2c4g.11186623.help-menu-29932.d_5_1_4_6_1.94cc25fdYQYRxm&scm=20140722.H313855..OR_help-T_cn~zh-V_1#section-cmf-k7d-jg5
AVPDelegate是三方sdk的接口
@interface SimplePlayerViewController ()<AVPDelegate>
@end
- (void)viewDidLoad {
self.player = [[AliPlayer alloc] init];
self.player.playerView = self.avpPlayerView.playerView;
self.player.delegate = self;
//...
}
/*
@brief 错误代理回调
@param player 播放器player指针
@param errorModel 播放器错误描述,参考AliVcPlayerErrorModel
/ - (void)onError:(AliPlayer)player errorModel:(AVPErrorModel )errorModel {
// 提示错误,及stop播放
}
/*
@brief 播放器事件回调
@param player 播放器player指针
@param eventType 播放器事件类型,@see AVPEventType
/
-(void)onPlayerEvent:(AliPlayer*)playereventType:(AVPEventType)eventType{
-}
4***@qq.com (作者)
引入的framework中的AVPDef.h中声明了一个enum
typedef enum AVPEventType: NSUInteger {
/@brief 准备完成事件*/
/***@brief Preparation completion event/
AVPEventPrepareDone,
/@brief 自动启播事件*/
/@brief Autoplay start event*/
AVPEventAutoPlayStart,
/*@brief 首帧显示事件/
/@brief First frame display event*/
AVPEventFirstRenderedStart,
/@brief 播放完成事件*/
/***@brief Playback completion event/
AVPEventCompletion,
/@brief 缓冲开始事件*/
/@brief Buffer start event*/
AVPEventLoadingStart,
/*@brief 缓冲完成事件/
/@brief Buffer completion event*/
AVPEventLoadingEnd,
/@brief 跳转完成事件*/
/***@brief Seeking completion event/
AVPEventSeekEnd,
/@brief 循环播放开始事件*/
/@brief Loop playback start event*/
AVPEventLoopingStart,
/*@brief 清屏完成事件/
/@brief clear screen done event*/
AVPEventClearScreenDone,
} AVPEventType;
我使用的代码是
import {AVPEventType } from "AliyunPlayer"
我调用AVPEventType.PrepareDone或者AVPEventType.AVPEventPrepareDone,都是报错type 'AVPEventType' has no member 'xxxxxx'
我应该怎么改才不会报错呢
2025-03-03 16:34