4***@qq.com
4***@qq.com
  • 发布:2025-02-27 17:23
  • 更新:2025-02-28 15:34
  • 阅读:102

三方sdk是oc写的,回调事件是重写写在.m文件中的接口来写的,uts页面插件中怎么实现

分类:uts

文档地址: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{
    -}
2025-02-27 17:23 负责人:DCloud_iOS_LZY 分享
已邀请:
DCloud_iOS_LZY

DCloud_iOS_LZY

SimplePlayerViewController 这个类都可以在uts中实现,或者swift混编实现。AVPDelegate接口在swift中需要怎么写,在uts中就怎么写

  • 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

要回复问题请先登录注册