x// 清晰度回调
onHDReceivedVideoQuality
// 示例
DWLive.onHDReceivedVideoQuality = function (data) {
console.log(data)
}
data: [
{
quality: 0, //number
desc: '原画' //string
}
]
/*
*@ 获取当前清晰度
*@ return 0
*/
getQualityIndex()
// 示例
DWLiev.getQualityIndex()
/*
*@ 切换清晰度
*@ params quality 0; callback
*/
changeQuality(quality, callback)
// 示例
DWLiev.changeQuality(0, function (resp) {
console.log(resp)
})
xxxxxxxxxx
// 回放打点数据回调
on_cc_loadDotPointsData
//示例
window.on_cc_loadDotPointsData = function (data) {
console.log(data)
}
data: [
{
time: 0 // s
desc: 'xxxx'
}
]
xxxxxxxxxx
/**
* 收到抽奖
* @param lotteryAction 抽奖的一些信息
*/
onLottery
LotteryAction {
//抽奖订单ID
lotteryId: String
//抽奖订单状态 0抽奖创建成功, 1抽奖取消成功, 2抽奖已完成, 3抽奖异常结束
lotteryStatus: int
//抽奖订单类型 0普通抽奖类型(暂无别的抽奖类型)
lotteryType: int
//是否存在抽奖 注意当该字段为false的时候 无其他字段
haveLottery: boolean
//中奖信息
LotteryWinInfo: {
//中奖人需要提交的信息
collectTemplate: [
{
//索引 提交抽奖的时候用到
index: int
//标题
title: String
//提示语
tips: String
}
];
//是否中奖 true中奖 false未中奖
isWinner: boolean
//自己的信息
LotteryOwnUserInfo: {
userAvatar: 'xxxx' String
//名称
priuserNamevate: 'xxxx' String
//用户id
userId: 'xxxx' String
//中奖码
prizeCode: 'xxxx' String
};
//中奖人名单信息
userInfos: array [
{
//头像
userAvatar: 'xxx' String
//用户名
userName:'xxxx' String
//用户id
userId: 'xxxx' String
}
];
//奖品信息
LotteryPrize: {
name: 'xxxx' string
};
};
}
// 示例
DWLive.onLottery = function (data) {
if (data.haveLottery) { // 有抽奖
lotteryId = data.lotteryId
if (data.lotteryStatus === 0) { // 抽奖ing
} else if (data.lotteryStatus === 1) { // 取消抽奖
} else if (data.lotteryStatus === 2) { // 抽奖结束
if (data.LotteryWinInfo.isWinner) { // 中奖
} else { // 未中奖
}
} else if (data.lotteryStatus === 3) { // 抽奖异常结束
}
} else { // 没有抽奖,隐藏抽奖相关
}
}
/**
* @param commitInfos 提交抽奖信息
* @param callback 抽奖回调
*/
commitLottery
// 参数说明
commitInfos: {
lotteryId: '' // 抽奖id
collectInfos: [
{
//收到中奖信息中对应的 LotteryCollectTemplate.index
index:int ;
//用户填写的信息
value: String ;
}
]
}
// 示例
DWLive.commitLottery(commitInfos, {
onSuccess: function (reuslt) {
console.log('commitLottery:: reuslt', reuslt)
},
onError: function (err) {
console.log('commitLottery:: err', err)
}
})