@rongcloud/plugin-wechat-rtc
Version:
@rongcloud/plugin-wechat-rtc
2 lines (1 loc) • 2.34 kB
JavaScript
import{__innerGetCoreContext__ as e,__innerGetPusherContext__ as t,RCAudioVolumeType as a,ORIENTATION as i,ASPECT as o,LOCALMIRROR as r,AUDIOREVERBTYPE as n,BEAUTYSTYLE as l,FILTER as s,RCDevicePosition as u}from"@rongcloud/plugin-wechat-rtc";const m=e(),v=t();Component({data:{url:"",enableCamera:!0,enableMic:!0,isShowComponent:!1},properties:{style:{type:String,value:"width:100%;height:100px"},minBitrate:{type:Number,value:200},maxBitrate:{type:Number,value:1e3},audioVolumeType:{type:a,value:a.AUTO},beauty:{type:Number,value:0},whiteness:{type:Number,value:0},autoFocus:{type:Boolean,value:!0},orientation:{type:i,value:i.VERTICAL},aspect:{type:o,value:o.NINEDIVIDESIXTEEN},waitingImage:{type:String,value:""},zoom:{type:Boolean,value:!1},remoteMirror:{type:Boolean,value:!1},localMirror:{type:r,value:r.AUTO},audioReverbType:{type:n,value:n.CLOSE},enableAgc:{type:Boolean,value:!1},enableAns:{type:Boolean,value:!1},videoWidth:{type:Number,value:360},videoHeight:{type:Number,value:640},beautyStyle:{type:l,value:l.SMOOTH},filter:{type:s,value:s.STANDARD},devicePosition:{type:u,value:u.FRONT}},lifetimes:{attached(){const e=wx.createLivePusherContext(),t=this;m.addEventListener({setPusherUrl(e){t.setData({url:e}),!e&&t.setData({isShowComponent:!1})},showComponent(){t.setData({isShowComponent:!0})},startPreview(){e.startPreview()},stopPreview(){e.stopPreview()},openCamera(){t.setData({enableCamera:!0})},closeCamera(){t.setData({enableCamera:!1})},switchCamera(){e.switchCamera()},openMicphone(){t.setData({enableMic:!0})},closeMicphone(){t.setData({enableMic:!1})}})},detached(){}},methods:{stateChangeEvent:function(e){this.triggerEvent("statechange",e.detail),v.emit("stateChange",e.detail)},netStatusEvent:function(e){this.triggerEvent("netstatus",e.detail),v.emit("netStatus",e.detail.info)},renderErrorEvent:function(e){this.triggerEvent("error",e.detail),v.emit("renderError",e.detail)},bgmStartEvent:function(e){this.triggerEvent("bgmstart",e.detail),v.emit("bgmStart",e.detail)},bgmProgressEvent:function(e){this.triggerEvent("bgmprogress",e.detail),v.emit("bgmProgress",e.detail)},bgmCompleteEvent:function(e){this.triggerEvent("bgmprogress",e.detail),v.emit("bgmComplete",e.detail)},audioVolumeNotifyEvent:function(e){this.triggerEvent("audiovolumenotify",e.detail),v.emit("audioVolumeNotify",e.detail.volume)}}});