1.0.4 • Published 2 years ago
live-clv v1.0.4
使用
js调用
const ybSdk = require("live-clv")
// 支持回调函数及Promise两种方式, 当传入回调时,不触发Promise
ybSdk.enterRoom({
type: 'link',
value: 'short link'
}, (url) => {
this.setDate({
ybSrc: url
})
})
// or
ybSdk.enterRoom({
type: 'liveId',
value: 'xxxxxid'
}, (url) => {
this.setDate({
ybSrc: url
})
})
<web-view src="{{ybSrc}}"></web-view>
方法 | 参数 |
---|---|
enterRoom | params, success, failed |
params
当 type 值为
liveId
时, value 为直播间Id
字段 | 类型 |
---|---|
value | string |
type | 'link'、'liveId' |
组件调用
"usingComponents": {
"live-clv": "/node_modules/live-clv/components/live-clv/live-clv"
}
<live-clv src="{{ybSrc}}"></live-clv>
属性
当 type 值为
liveId
时, value 为直播间Id当为短链接时,确保配置业务域名
属性 | 描述 |
---|---|
src | 短链接或直播Id |
type | 'link'、'liveId' 默认link |
事件
事件 | 描述 |
---|---|
bindmessage | 网页向小程序 postMessage 时,会在特定时机(小程序后退、组件销毁、分享)触发并收到消息。 |
bindload | 网页加载成功时候触发此事件。 |
binderror | 网页加载失败的时候触发此事件。 |
业务域名
// http
https://cast.263live.net
https://logcollect.263cv.net:8099
https://cclocation.263cv.net:18080
https://live.263cv.net
https://cclogin.263cv.net:18081
https://cvac.263cv.net
https://appserver.263.net:7777/
// ws
wss:ccbroker.263cv.net:18043