1 line
22 KiB
JavaScript
1 line
22 KiB
JavaScript
require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesLive/live/live"],{"04c8":function(e,t,o){"use strict";var i=o("48e3"),n=o.n(i);n.a},"1b87":function(e,t,o){"use strict";o.r(t);var i=o("8322"),n=o("93b1");for(var s in n)["default"].indexOf(s)<0&&function(e){o.d(t,e,(function(){return n[e]}))}(s);o("5576"),o("04c8");var a=o("828b"),r=Object(a["a"])(n["default"],i["b"],i["c"],!1,null,"1eb94592",null,!1,i["a"],void 0);t["default"]=r.exports},"48e3":function(e,t,o){},"495e":function(e,t,o){"use strict";(function(e,t){var i=o("47a9");o("7d57");i(o("3240"));var n=i(o("1b87"));e.__webpack_require_UNI_MP_PLUGIN__=o,t(n.default)}).call(this,o("3223")["default"],o("df3c")["createPage"])},5576:function(e,t,o){"use strict";var i=o("9788"),n=o.n(i);n.a},8322:function(e,t,o){"use strict";o.d(t,"b",(function(){return i})),o.d(t,"c",(function(){return n})),o.d(t,"a",(function(){}));var i=function(){var e=this.$createElement;this._self._c},n=[]},"93b1":function(e,t,o){"use strict";o.r(t);var i=o("fe84"),n=o.n(i);for(var s in i)["default"].indexOf(s)<0&&function(e){o.d(t,e,(function(){return i[e]}))}(s);t["default"]=n.a},9788:function(e,t,o){},fe84:function(e,t,o){"use strict";(function(e){var i=o("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i(o("7ca3")),s=i(o("74c1")),a=i(o("1557")),r=i(o("71bb")),l={components:{liveCart:function(){o.e("pagesLive/live/live-part/liveCart").then(function(){return resolve(o("c865"))}.bind(null,o)).catch(o.oe)},liveGift:function(){o.e("pagesLive/live/live-part/liveGift").then(function(){return resolve(o("bfaf"))}.bind(null,o)).catch(o.oe)},liveMsg:function(){o.e("pagesLive/live/live-part/liveMsg").then(function(){return resolve(o("0a91"))}.bind(null,o)).catch(o.oe)},livePlan:function(){Promise.all([o.e("common/vendor"),o.e("pagesLive/live/live-part/livePlan")]).then(function(){return resolve(o("bd2d"))}.bind(null,o)).catch(o.oe)},liveOrder:function(){o.e("pagesLive/live/live-part/liveOrder").then(function(){return resolve(o("3114"))}.bind(null,o)).catch(o.oe)},liveAnchor:function(){o.e("pagesLive/live/live-part/liveAnchor").then(function(){return resolve(o("5a87"))}.bind(null,o)).catch(o.oe)},liveMore:function(){o.e("pagesLive/live/live-part/liveMore").then(function(){return resolve(o("b307"))}.bind(null,o)).catch(o.oe)},liveShare:function(){o.e("pagesLive/live/live-part/liveShare").then(function(){return resolve(o("f881"))}.bind(null,o)).catch(o.oe)},liveRank:function(){o.e("pagesLive/live/live-part/liveRank").then(function(){return resolve(o("8422"))}.bind(null,o)).catch(o.oe)},Likes:function(){o.e("pagesLive/live/live-part/likes/index").then(function(){return resolve(o("bd87"))}.bind(null,o)).catch(o.oe)},share:function(){o.e("pagesLive/live/live-part/dialog/share").then(function(){return resolve(o("8945"))}.bind(null,o)).catch(o.oe)},Countdown:function(){o.e("pagesLive/live/live-part/countdown_nvue").then(function(){return resolve(o("799b"))}.bind(null,o)).catch(o.oe)},AppShare:function(){Promise.all([o.e("common/vendor"),o.e("pagesLive/live/live-part/app-nvue-share")]).then(function(){return resolve(o("c6ce"))}.bind(null,o)).catch(o.oe)},preview:function(){o.e("pagesLive/live/preview").then(function(){return resolve(o("45f6"))}.bind(null,o)).catch(o.oe)}},data:function(){var e;return e={statusBarH:"",headerBarH:"",winHeight:"",winWidth:"",videoIndex:0,clickNum:0,giftipShowist:[],sence:"",room_id:0,shop_supplier_id:0,role:"",loading:!0,commentsList:[],maxCommentSize:100,roomDetail:{supplier:{shop_supplier_id:0}},giftName:"",gift_num:0,hasFollow:!1,giftList:[],isCaster:!1,user:{},giftInfo:{nickName:"",avatarUrl:"",giftName:"",giftImage:""},explain_product_id:"",explain_product:null,num:0,digg_num:0,digg_times:5,digg_timer:null,is_replay:!1,replay_url:"",is_start:!1,qrcode:null,toMsg:"",emojiData:[],countdownConfig:{startstamp:0,endstamp:0,title:""},isAppShare:!1,appParams:{title:"",summary:"",path:""},zOrderMediaOverlay:!1,zOrderOnTop:!1,renderMode:1,mirrorMode:0,engine_load:!1},(0,n.default)(e,"isCaster",!1),(0,n.default)(e,"whiteness",5),(0,n.default)(e,"beauty",5),(0,n.default)(e,"userInfo",{}),(0,n.default)(e,"channel",""),(0,n.default)(e,"view_uid",0),(0,n.default)(e,"agoraView",null),(0,n.default)(e,"agoraRtm",null),(0,n.default)(e,"platform",""),(0,n.default)(e,"agoraAppId",""),(0,n.default)(e,"appId",""),(0,n.default)(e,"uid",""),(0,n.default)(e,"liveChannelId",""),(0,n.default)(e,"token",""),(0,n.default)(e,"nickName",""),(0,n.default)(e,"beautyOptions",{enabled:!0,contrastLevel:1,lightening:.6,smoothness:.5,redness:.1,sharpness:.3}),(0,n.default)(e,"is_preview",!1),(0,n.default)(e,"isExplain",!1),(0,n.default)(e,"explain",{}),(0,n.default)(e,"online_count",0),(0,n.default)(e,"intervalTime",null),e},beforeCreate:function(){},created:function(){console.log("------live created"),this.platform=e.getSystemInfoSync().platform;var t=e.getSystemInfoSync().statusBarHeight,o=t+50,i=e.getSystemInfoSync().windowHeight,n=e.getSystemInfoSync().windowWidth;this.statusBarH="".concat(t,"px"),this.headerBarH="".concat(o,"px"),this.winHeight="".concat(i,"px"),this.winWidth="".concat(n,"px")},onLoad:function(t){e.setKeepScreenOn({keepScreenOn:!0});var o=s.default.getSceneData(t);this.room_id=t.room_id?t.room_id:o.rid,this.role="create"==t.sence?"broadcaster":"audience"},onReady:function(){},onUnload:function(){},onShow:function(){},mounted:function(){console.log("-------agora-sdk---------------"+e.getSystemInfoSync().platform),"android"===this.platform?(r.default.requestAndroidPermission("android.permission.RECORD_AUDIO"),r.default.requestAndroidPermission("android.permission.CAMERA"),this.agoraView=this.$refs.agoraView,this.agoraRtm=this.$refs.agoraRtm):"ios"===this.platform&&(this.agoraView=agoraRtc,this.agoraRtm=agoraRtm),this.uid=this.getRequest().getUserId(),this.getRoomInfo()},methods:{getRequest:function(){return this},getRoomInfo:function(){var t=this;e.showLoading({title:"正在进入"}),t.getRequest()._post("plus.live.room/detail",{room_id:t.room_id},(function(o){console.log("获取房间"),console.log(o.data),e.hideLoading(),t.loading=!1,t.roomDetail=o.data.model,t.giftName=o.data.gift_name,t.hasFollow=o.data.hasFollow,t.digg_num=o.data.model.digg_num,t.countdownConfig.endstamp=t.roomDetail.start_time,t.user=o.data.user,t.isCaster=o.data.isCaster,t.isCaster?t.view_uid=0:t.view_uid=o.data.model.user_id,t.liveRoomStart(t.roomDetail,t.user),t.$nextTick((function(){t.initProduct()}))}))},liveRoomStart:function(t,o){if(this.roomDetail=t,this.userInfo=o,this.channel="channel_"+t.supplier.shop_supplier_id,this.liveChannelId="channel_"+t.supplier.shop_supplier_id,this.isCaster){var i=e.getStorageSync("whiteness");i&&(this.whiteness=i);var n=e.getStorageSync("beauty");n&&(this.beauty=n)}else console.log("观众进入");this.loginRoom()},loginRoom:function(){var t=this;e.showLoading({title:"正在进入"}),t.getRequest()._get("plus.live.agora.api/login",{room_id:t.roomDetail.room_id,channel:t.channel},(function(o){if(console.log("进入房间"),console.log(o.data),t.appId=o.data.appId,t.agoraAppId=o.data.appId,t.token=o.data.userSign,t.nickName=o.data.user.nickName,0!=t.roomDetail.live_status){if(t.isCaster){if(t.uid!=t.roomDetail.user_id)return void t.getRequest().showError("你不是此房间主播",(function(){e.navigateBack()}))}else if(102==t.roomDetail.live_status)return void t.getRequest().showError("直播未开始",(function(){e.navigateBack()}));103!=t.roomDetail.live_status&&107!=t.roomDetail.live_status?(t.initRoom(),t.agoraView.create({appid:t.agoraAppId},(function(e){t.engine_load=!0,t.showLike=!0,console.log("create---------"),t.isCaster?(t.is_preview=!0,console.log(t.roomDetail.live_status),102==t.roomDetail.live_status?t.startPreview():t.openLive()):t.enterRoom(),t.addRtcListeners()}))):t.getRequest().showError("直播已结束",(function(){e.navigateBack()}))}else t.getRequest().showError("直播审核中",(function(){e.navigateBack()}))}))},closePreview:function(){e.navigateBack()},switchCamera:function(){this.agoraView.switchCamera((function(e){console.log("--------------------switchCamera-------------------")}))},setBeautyOptions:function(t){if(console.log("setBeautyOptions"+t),"set"==t){var o=e.getStorageSync("lightening");o?this.beautyOptions.lightening=o:e.setStorageSync("smoothness",this.beautyOptions.lightening);var i=e.getStorageSync("smoothness");i?this.beautyOptions.smoothness=i:e.setStorageSync("smoothness",this.beautyOptions.smoothness);var n=e.getStorageSync("redness");n?this.beautyOptions.redness=n:e.setStorageSync("redness",this.beautyOptions.redness);var s=e.getStorageSync("sharpness");s?this.beautyOptions.sharpness=s:e.setStorageSync("sharpness",this.beautyOptions.sharpness)}else this.beautyOptions.lightening=.6,e.setStorageSync("lightening",this.beautyOptions.lightening),this.beautyOptions.smoothness=.5,e.setStorageSync("smoothness",this.beautyOptions.smoothness),this.beautyOptions.redness=.1,e.setStorageSync("redness",this.beautyOptions.redness),this.beautyOptions.sharpness=.3,e.setStorageSync("sharpness",this.beautyOptions.sharpness);this.agoraView.setBeautyEffectOptions(this.beautyOptions)},setDefinition:function(t){console.log("setDefinition="+t);e.setStorageSync("vd",t),this.agoraView.setVideoEncoderConfiguration({vd:t},(function(e){console.log("setVideoEncoderConfiguration")}))},startPreview:function(){this.agoraView.enableVideo((function(e){})),"android"==this.platform&&this.agoraView.setupLocalVideo({channelName:this.liveChannelId,uid:this.uid},(function(e){console.log("setupLocalVideo")})),this.setBeautyOptions();var t=e.getStorageSync("vd");t||(t=0),this.setDefinition(t),this.agoraView.startPreview((function(e){console.log("--------------------startPreview-------------------")}))},rtmLogin:function(){var e=this,t=e.agoraRtm;t.createInstance({appid:e.agoraAppId},(function(e){console.log("-------------rtmLogin createInstance--------")})),e.addRtmListeners(),e.getRequest()._get("plus.live.agora.api/rtmToken",{room_id:e.roomDetail.room_id},(function(o){console.log("-------------rtmToken--------"),console.log(o),t.login({token:o.data.userSign,uid:""+e.uid},(function(e){console.log("-------------agoraRtm login--------")}))}),(function(e){console.log(e)}))},addRtmListeners:function(){var e=this;globalEvent.addEventListener("io.agora.rtm.ConnectionStateChanged",(function(t){3==t.data[0]&&2==t.data[1]&&e.onLoginSuccess()})),globalEvent.addEventListener("io.agora.rtm.MessageReceived",(function(t){e.showMsg(t.data[0])}))},addRtcListeners:function(){var e=this;globalEvent.addEventListener("io.agora.rtc.JoinChannelSuccess",(function(t){e.onJoinChannelSuccess(t)})),globalEvent.addEventListener("io.agora.rtc.LeaveChannel",(function(t){e.onLeaveChannel(t)})),globalEvent.addEventListener("io.agora.rtc.RemoteVideoStateChanged",(function(t){e.onRemoteVideoStateChanged(t)})),globalEvent.addEventListener("io.agora.rtc.UserJoined",(function(t){e.onUserJoined(t)})),globalEvent.addEventListener("io.agora.rtc.UserOffline",(function(t){e.onUserOffline(t)}))},enterRoom:function(){this.agoraView.setChannelProfile(1,(function(e){})),this.agoraView.setClientRole(2,(function(e){})),this.agoraView.enableAudio((function(e){})),this.agoraView.enableVideo((function(e){})),"android"==this.platform&&this.agoraView.setupRemoteVideo({channelName:this.liveChannelId,uid:this.view_uid},(function(e){})),this.agoraView.joinChannel({token:this.token,channelName:this.liveChannelId,uid:this.uid},(function(e){console.log("--------------------joinChannel enterRoom-------------------")}),(function(e){console.log("--------------------joinChannel enterRoom-------------------")}))},openLive:function(){var e=this.agoraView;this.is_preview&&(this.is_preview=!1,e.stopPreview((function(e){console.log("--------------------stopPreview-------------------")}))),e.setChannelProfile(1,(function(e){})),e.setClientRole(1,(function(e){})),e.enableAudio((function(e){})),e.enableVideo((function(e){})),"android"==this.platform&&e.setupLocalVideo({channelName:this.liveChannelId,uid:this.uid},(function(e){console.log("setupLocalVideo")})),e.joinChannel({token:this.token,channelName:this.liveChannelId,uid:this.uid},(function(e){console.log("--------------------joinChannel-------------------"),console.log()}))},initRoom:function(){this.getGift(),this.initemoji()},showProduct:function(e){var t=this;t.explain_product_id=e,t.getRequest()._post("plus.live.room/product_detail",{product_id:t.explain_product_id},(function(e){t.explain_product=e.data.model,console.log(t.explain_product)}))},synRoomInfo:function(e){var t=this;t.getRequest()._post("plus.live.room/syn_room",{room_id:t.roomDetail.room_id},(function(e){var o={type:"views",views:e.data.model.views,digg_num:e.data.model.digg_num};t.sendMsg(JSON.stringify(o))}))},initProduct:function(){this.roomDetail.currentProduct&&(this.explain_product={product_image:this.roomDetail.currentProduct.image[0].file_path,product_price:this.roomDetail.currentProduct.product_price,product_id:this.roomDetail.currentProduct.product_id}),console.log("--------explain_product-------------"),console.log(this.explain_product)},gotoProduct:function(t){var o="/pages/product/detail/detail?product_id="+this.explain_product.product_id+"&room_id="+this.room_id;e.navigateTo({url:o})},handleSlider:function(e){var t=e.detail.current;this.videoIndex>=0&&(this.videoContextList[this.videoIndex].pause(),this.videoContextList[this.videoIndex].seek(0)),t===this.videoIndex+1?this.videoContextList[this.videoIndex+1].play():t===this.videoIndex-1&&this.videoContextList[this.videoIndex-1].play(),this.videoIndex=t},play:function(e){this.videoContextList[e].play()},pause:function(e){this.videoContextList[e].pause()},handleAttention:function(e){var t=this.vlist;t[e].attention=!t[e].attention,this.vlist=t},handleLiveCart:function(){this.$refs.liveCart.show()},handleLiveGift:function(){this.$refs.liveGift.show()},handleRollMsg:function(){this.$refs.liveMsg.show()},sendChannelMsg:function(e){var t={type:"text",msg:e,registerLevel:this.registerLevel,nickName:this.nickName};this.sendMsg(t)},closeMsg:function(e){var t={type:"text",msg:e,nickName:this.user.nickName};this.sendMsg(JSON.stringify(t))},removeComment:function(){var e=this,t=e.commentsList.length-e.maxCommentSize;if(t>0)for(var o=0;o<t;o++)e.commentsList.shift();e.$nextTick((function(){e.toMsg="comment"+(e.commentsList.length-1)}))},getGift:function(){var e=this;e.getRequest()._get("plus.live.room/gift",{},(function(t){console.log("====gift======="),console.log(t);for(var o=[],i=[],n=0,s=0;s<t.data.list.length;s++)n++,i.push(t.data.list[s]),n>=8&&(o.push(i),i=[],n=0);i.length>0&&o.push(i),e.giftList=o,console.log(e.giftList)}))},openPlan:function(){this.$refs.livePlan.show()},closePlan:function(){this.$refs.liveGift.show()},openOrder:function(){this.$refs.liveOrder.show()},closeOrder:function(){this.$refs.liveCart.show()},setProduct:function(e){console.log("explainProduct"),console.log(e),null==e?(this.isExplain=!1,this.explain={}):(this.isExplain=!0,this.explain=e);var t={type:"explain",explain:this.explain,isExplain:this.isExplain};this.sendMsg(t)},sendMsg:function(e){var t=this,o=t.agoraRtm,i=JSON.stringify(e);o.sendMessage({message:i},(function(e){console.log(i),t.showMsg(i)}),(function(e){console.log(e)}))},digg:function(){if(console.log("点击屏幕"),!this.isCaster){var e=this;e.$refs.likes.handleClick(),console.log("----------digg---------------"),e.getRequest()._post("plus.live.room/digg",{room_id:e.room_id,num:1},(function(t){console.log("----------digg---------------");var o=t.data,i={type:"digg",digg_num:o};e.sendMsg(i)}))}},showMsg:function(t){var o=this,i=JSON.parse(t);if(console.log(i),"text"==i.type||"buy"==i.type||"join"==i.type||"enter"==i.type)o.commentsList.push(i),o.removeComment();else if("digg"==i.type)console.log("digg"),o.digg_num=i.digg_num.digg_num,console.log(o.digg_num);else{if("banSay"==i.type&&o.uid==i.user_id)return o.isbanSay=!0,void e.showToast({title:"您已被禁言",icon:"none"});if("gift_num"==i.type)o.roomDetail.gift_num=i.msg;else if("gift"==i.type)o.giftInfo={nickName:i.nickName,avatarUrl:i.avatarUrl,giftName:o.getGiftName(i.msg),giftImage:o.getGiftImage(i.msg)},setTimeout((function(){o.giftInfo={nickName:""}}),5e3);else if("kickPerson"==i.type&&o.uid==i.user_id)e.showToast({title:"您已被踢出直播间",icon:"none"}),o.closeLive();else{if("openSay"==i.type&&o.uid==i.user_id)return e.showToast({title:"您已被取消禁言",icon:"none"}),void(o.isbanSay=!1);"openPerson"==i.type&&o.uid==i.user_id?e.showToast({title:"您已被取消踢出直播间",icon:"none"}):"explain"==i.type&&(this.explain=i.explain,this.isExplain=i.isExplain,this.showProduct(i.explain),this.showLike=!1,this.showLike=!0)}}},followFunc:function(){var e=this;e.getRequest()._post("user.favorite/add",{shop_supplier_id:e.roomDetail.supplier.shop_supplier_id,pid:e.roomDetail.supplier.shop_supplier_id,type:10},(function(t){console.log(t),e.hasFollow=!e.hasFollow}))},openAnchor:function(){this.$refs.liveAnchor.show()},changeFollow:function(e){this.hasFollow=e},openMore:function(){this.$refs.liveMore.show()},openShare:function(e){this.$refs.liveShare.show()},liveSet:function(e){this.$refs.liveRoom.liveSet(e)},openRank:function(){this.$refs.liveRank.show()},sendGift:function(e){var t=e.split(","),o={type:"gift",msg:t[0],nickName:this.user.nickName,avatarUrl:this.user.avatarUrl};this.sendMsg(o);var i={type:"gift_num",msg:t[1]};this.sendMsg(i)},getGiftName:function(e){var t="";for(var o in this.giftList)for(var i=0;i<this.giftList[o].length;i++){var n=this.giftList[o][i];if(parseInt(e)===n.gift_id){t=n.gift_name,console.log(t);break}}return t},getGiftImage:function(e){var t="";for(var o in this.giftList)for(var i=0;i<this.giftList[o].length;i++){var n=this.giftList[o][i];if(parseInt(e)===n.gift_id){t=n.file_path;break}}return t},livePoster:function(){var t=this;e.showLoading({title:"加载中"});t.getRequest()._get("plus.live.Room/poster",{room_id:t.room_id,source:"wx"},(function(e){t.qrcode=e.data.qrcode}),null,(function(){e.hideLoading()}))},closeShare:function(){this.qrcode=null},onShareAppMessage:function(){var e=this.getRequest().getShareUrlParams({room_id:this.room_id,sence:"audience"});return{title:this.roomDetail.name,path:"/pagesLive/live/live?"+e,imageUrl:this.roomDetail.shareFilePath}},initemoji:function(){for(var e=Math.ceil(a.default.length/21),t=0;t<e;t++){this.emojiData[t]=[];for(var o=0;o<21;o++)a.default[21*t+o]&&this.emojiData[t].push(a.default[21*t+o])}console.log("initemoji:success")},goBack:function(){e.redirectTo({url:"/pagesLive/live/index"})},closeLive:function(){var t=this;t.isCaster?e.showModal({title:"提示",content:"确定要结束当前直播吗?",success:function(e){e.confirm&&(t.getRequest()._get("plus.live.agora.api/record_stop",{room_id:t.room_id},(function(e){console.log("record_stop")})),t.getRequest()._post("plus.live.room/set_status",{room_id:t.room_id,status:103},(function(e){console.log("set_status"),t.leaveChannel("auto")})))}}):t.leaveChannel("auto")},onJoinChannelSuccess:function(e){var t=this;console.log("------------onJoinChannelSuccess---------------"),t.rtmLogin(),t.isCaster&&(t.getRequest()._post("plus.live.room/set_status",{room_id:t.room_id,status:101},(function(e){}),(function(e){console.log(e)})),t.getRequest()._post("plus.live.agora.api/record_acquire",{room_id:t.roomDetail.room_id},(function(e){console.log("--------record_acquire-----------"),console.log(e),t.getRequest()._post("plus.live.agora.api/record_start",{room_id:t.roomDetail.room_id},(function(e){setTimeout((function(){t.getRequest()._post("plus.live.agora.api/record_query",{room_id:t.roomDetail.room_id},(function(e){console.log("--------record_query-----------"),console.log(e)}))}),3e4)}))})))},onLeaveChannel:function(e){console.log("-------------onLeaveChannel---------------")},onRemoteVideoStateChanged:function(e){console.log("-------------onRemoteVideoStateChanged---------------")},onUserJoined:function(e){console.log("-------------onUserJoined---------------")},onUserOffline:function(e){console.log("-------------onUserOffline---------------"),this.leaveChannel("over")},leaveChannel:function(t){var o=this;console.log("leaveChannel"),clearInterval(o.intervalTime),"android"==o.platform&&(o.agoraRtm.leave(),o.agoraRtm.release({channelId:o.liveChannelId})),o.agoraView.leaveChannel((function(e){console.log("leaveChannel success"),o.agoraView.destroy()}));var i=o.isCaster?"1":"0",n="/pagesLive/live/live-over?room_id="+o.room_id+"&isCaster="+i;console.log("url:"+n),o.isCaster?e.redirectTo({url:n}):"auto"==t?e.navigateBack():e.redirectTo({url:n})},onLoginSuccess:function(e){this.joinChannel()},joinChannel:function(){var e=this,t=e.agoraRtm;t.createChannel({channelId:e.liveChannelId},(function(o){t.join((function(t){e.onJoinSuccess()}))}))},onLoginFailure:function(e){console.log("onLoginFailure"),console.log(e)},onLogoutSuccess:function(e){console.log("onLogoutSuccess"),console.log(e)},onLogoutFailure:function(e){console.log("onLogoutFailure"),console.log(e)},onJoinSuccess:function(e){var t=this,o={type:"join",msg:"",registerLevel:t.registerLevel,nickName:t.nickName};t.sendMsg(o),t.synRoomData(),t.intervalTime=setInterval((function(){t.synRoomData()}),1e4)},onJoinFailure:function(e){console.log("onJoinFailure"),console.log(e)},onChannelMessageReceived:function(e){console.log("onChannelMessageReceived"),this.showMsg(e.detail.messageData)},changeVirtualBackground:function(t){var o=this;console.log("changeVirtualBackground e="+t),""!=t?e.downloadFile({url:t,success:function(e){200===e.statusCode&&(console.log("下载成功"),o.agoraView.enableVirtualBackground({enabled:!0,source:plus.io.convertLocalFileSystemURL(e.tempFilePath),backgroundSourceType:2,color:16777215,blur_degree:1},(function(e){console.log("changeVirtualBackground success"),console.log(e)})))}}):o.agoraView.enableVirtualBackground({enabled:!1},(function(e){console.log("changeVirtualBackground cancel"),console.log(e)}))},synRoomData:function(){var e=this,t=e.agoraRtm;t.getChannelMemberCount({channelIds:e.liveChannelId},(function(t){e.online_count="ios"==e.platform?t[0]["memberCount"]:t.memberCount[0].memberCount}))}}};t.default=l}).call(this,o("df3c")["default"])}},[["495e","common/runtime","common/vendor","pagesLive/common/vendor"]]]); |