UNPKG

@rongcloud/plugin-wechat-rtc

Version:

@rongcloud/plugin-wechat-rtc

2 lines (1 loc) 2.81 kB
var t,e,i,n,a,o,r,u,s,E,l;!function(t){t.VERTICAL="vertical",t.HORIZONTAL="horizontal"}(t||(t={})),function(t){t[t.THREEDIVIDEFOUR=.75]="THREEDIVIDEFOUR",t[t.NINEDIVIDESIXTEEN=.5625]="NINEDIVIDESIXTEEN"}(e||(e={})),function(t){t.AUTO="auto",t.ENABLE="enable",t.DISABLE="disable"}(i||(i={})),function(t){t[t.CLOSE=0]="CLOSE",t[t.KTV=1]="KTV",t[t.LITTLEROOM=2]="LITTLEROOM",t[t.GREATHALL=3]="GREATHALL",t[t.LOW=4]="LOW",t[t.LOUD=5]="LOUD",t[t.METALLIC=6]="METALLIC",t[t.MAGNETIC=7]="MAGNETIC"}(n||(n={})),function(t){t.SMOOTH="smooth",t.NATURE="nature"}(a||(a={})),function(t){t.STANDARD="standard",t.PINK="pink",t.NOSTALGIA="nostalgia",t.BLUES="blues",t.ROMANTIC="romantic",t.COOL="cool",t.FRESHER="fresher",t.SOLOR="solor",t.AESTHETICISM="aestheticism",t.WHITENING="whitening",t.CERISERED="cerisered"}(o||(o={})),function(t){t.CONTAIN="contain",t.FILLCROP="fillCrop"}(r||(r={})),function(t){t.ORIGIN="origin",t.NOREFERRER="no-referrer"}(u||(u={})),function(t){t.SPEAKER="speaker",t.EAR="ear"}(s||(s={})),function(t){t.AUTO="auto",t.MEDIA="media",t.VOICECALL="voicecall"}(E||(E={})),function(t){t.FRONT="front",t.BACK="back"}(l||(l={}));const c=t=>t.properties.sid||t.id;let d,I;Component({data:{src:""},properties:{id:{type:String},sid:{type:String},style:{type:String,value:"width:100%;height:100px"},muted:{type:Boolean,value:!1},objectFit:{type:r,value:r.CONTAIN},orientation:{type:t,value:t.VERTICAL},autoPauseIfNavigate:{type:Boolean,value:!0},autoPauseIfOpenNative:{type:Boolean,value:!0},pictureInPictureMode:{type:String},referrerPolicy:{type:u,value:u.NOREFERRER},audioMode:{type:String}},lifetimes:{attached(){const t=c(this),e=this;d=globalThis.coreContext,I=globalThis.playerContext;const i=d.getSoundMode();this.properties.audioMode!==i&&this.setData({audioMode:i}),d.addEventListener({setPlayerSrc(i,n){i===t&&e.setData({src:n})},mute(i){i===t&&e.setData({muted:!0})},unmute(i){i===t&&e.setData({muted:!1})},setSoundMode(t){e.setData({audioMode:t})}})},detached(){}},methods:{stateChangeEvent:function(t){this.triggerEvent("statechange",c(this),t.detail),I.emit("stateChange",c(this),t.detail)},fullScreenChangeEvent:function(t){this.triggerEvent("fullscreenchange",c(this),t.detail),I.emit("fullScreenChange",c(this),t.detail)},netStatusEvent:function(t){this.triggerEvent("netstatus",c(this),t.detail),I.emit("netStatus",c(this),t.detail.info)},audioVolumeNotifyEvent:function(t){this.triggerEvent("audiovolumenotify",c(this),t.detail),I.emit("audioVolumeNotify",c(this),t.detail.volume)},enterPictureInPictureEvent:function(t){this.triggerEvent("enterpictureinpicture",c(this),t.detail),I.emit("enterPictureInPicture",c(this),t.detail)},leavePictureInPictureEvent:function(t){this.triggerEvent("leavepictureinpicture",c(this),t.detail),I.emit("leavePictureInPicture",c(this),t.detail)}}});