小程序官方直播插件怎么接入
<script src="ZegoExpressWebRTC-x.x.x.js"></script>
npm i miniprogram-zego
let { ZegoExpressEngine } = require("zego-express-engine-miniprogram"); // 以npm的方式引用
{ "plugins": { "zego-e-commerce": { "version": "1.0.4", "provider": "wx2b8909dae7727f25" } } }
{ "usingComponents": { "zego-pusher": "plugin://zego-e-commerce/zego-pusher", //推流组件 } }
<zego-pusher wx:if="{{loginType==='anchor'}}" id="zg-pusher" url="{{pushUrl}}" class="push-content" bindstatechange="onPushStateChange" bindnetstatus="onPushNetStateChange"></zego-pusher>
{ "usingComponents": { "zego-player": "plugin://zego-e-commerce/zego-player", //拉流组件 } }
<zego-player wx:if="{{loginType==='audience'}}" id="zg-player" sid="{{sid}}" url="{{playUrl}}" objectFit="fillCrop" class="play-content" bindstatechange="onPlayStateChange" bindnetstatus="onPlayNetStateChange"></zego-player>