本文提供云导播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的主要变化如下:
升级步骤
- 修改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>;
}