Log in to the WeChat open platform –” find the live broadcast in the sidebar –” apply for activation –”
After activation, click on live broadcast – “click to create live broadcast –” and then create a live broadcast room
Then return to hbiuIder, find the pages.json of your project, and add the live component API
"plugins": {
"live-player-plugin": {
"version": "1.3.0", // 注意填写该直播组件最新版本号,微信开发者工具调试时可获取最新版本号(复制时请去掉注释)
"provider": "wx2b03c6e691cd7370" // 必须填该直播组件appid,该示例值即为直播组件appid(复制时请去掉注释)
}
},
Return to the page and add the code where you want to jump to the live room, room_id is the id of the live room
<navigator class="live-box-list-item" :url="`plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${
item.room_id}`" hover-class="none" v-for="(item, index) in liveList" :key="index">
<view class="text u-m-b-20">{
{
item.name}}</view>
<u-image :src="item.image" mode="widthFix" width="100%"></u-image>
</navigator>