本文提供云导播Web SDK从2.2.X系列版本升级至2.3.0版本的步骤及SDK在2.3.0发生的重要变更。
背景信息
云导播Web SDK V2.3.0上线,新增控制台轮播台功能,优化性能和操作体验。如果您正在使用V2.2.X版本,可通过本文提供的方法升级至V2.3.0。
重要
继续使用2.2.X版本可能会出现不兼容的情况,建议您升级至V2.3.0。
与旧版本相比,V2.3.0的主要变化如下:
资源引用接入流程
主SDK(Caster-next)版本升级为2.3.0,包括CSS和JS资源。
播放器方案升级,需要变更相关依赖,移除
adapter.min.js、artc.js
和增加aliplayer-min.css、aliplayer-min.js
。
API接口
新增API接口支持播单型导播台。接口信息,请参见云导播API概览。
升级步骤
修改JS及CSS资源引用,参考下方代码更新资源。
<!doctype html> <html> <head> <meta charset="utf-8" /> <title>Your App</title> <!-- 云导播台样式文件 --> <link rel="stylesheet" href="https://g.alicdn.com/cdn-fe/caster-next/2.3.0/index.css" /> <link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.9.12/skins/default/aliplayer-min.css"> </head> <body> <!-- 导播台要挂载的元素 --> <div id=""caster-root></div> <!-- 播放器脚本 --> <script src="https://g.alicdn.com/de/prismplayer/2.9.12/aliplayer-min.js"></script> <!-- 云导播台 sdk 脚本 --> <script src="https://g.alicdn.com/cdn-fe/caster-next/2.3.0/index.js"></script> </body> </html>
在初始化代码
new Caster()
中增加参数UseRts
,取值为true
。升级后的初始化代码,请参见初始化SDK。API更新。使用新版播单型导播台,则需要增加如下接口调用:
export interface ServicesImp { // 产品:视频直播(LIVE),云导播服务API:https://help.aliyun.com/document_detail/60293.html#title-fjq-f1t-5qz DescribeShowList: (...args: any[]) => Promise<Resp>; AddShowIntoShowList: (...args: any[]) => Promise<Resp>; RemoveShowFromShowList: (...args: any[]) => Promise<Resp>; ModifyShowList: (...args: any[]) => Promise<Resp>; PlayChoosenShow: (...args: any[]) => Promise<Resp>; // 产品:视频点播(VOD),API文档 https://help.aliyun.com/document_detail/60574.html GetImageInfo: (...args: any[]) => Promise<Resp>; GetVideoInfos: (...args: any[]) => Promise<Resp>; }
该文章对您有帮助吗?