call.js 3.0 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesA/record/call"],{"489f":function(e,o,t){"use strict";var n=t("a65e"),r=t.n(n);r.a},"4cce":function(e,o,t){"use strict";t.r(o);var n=t("5217"),r=t("8812");for(var c in r)["default"].indexOf(c)<0&&function(e){t.d(o,e,(function(){return r[e]}))}(c);t("489f");var u=t("f0c5"),a=Object(u["a"])(r["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],void 0);o["default"]=a.exports},5217:function(e,o,t){"use strict";t.d(o,"b",(function(){return n})),t.d(o,"c",(function(){return r})),t.d(o,"a",(function(){}));var n=function(){var e=this.$createElement;this._self._c},r=[]},8812:function(e,o,t){"use strict";t.r(o);var n=t("b7cc"),r=t.n(n);for(var c in n)["default"].indexOf(c)<0&&function(e){t.d(o,e,(function(){return n[e]}))}(c);o["default"]=r.a},a65e:function(e,o,t){},b7cc:function(e,o,t){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0;var n=t("f7ce"),r={data:function(){return{trtcConfig:{debugMode:!1,sdkAppID:"1400396944",userID:"",userSig:"",template:"1v1",enableCamera:!0,enableMic:!0,enableAns:!0,enableAgc:!0,enableAutoFocus:!0},roomId:"",template:"1v1",timestamp:[]}},onLoad:function(e){var o=this;o.trtcConfig.userID=e.userId,o.callGetRoom().then((function(e){o.trtcConfig.userSig=e,console.log("开始调用初始化"),o.info()})),o.roomId=e.roomId},methods:{callGetRoom:function(){return new Promise((function(e,o){(0,n.getSig)({}).then((function(o){e(o.data.UserSig)})).catch((function(e){o(e)}))}))},info:function(){var e=this,o=this,t=this.selectComponent("#trtcroom"),n=t.EVENT;t.setData({trtcConfig:o.trtcConfig},(function(r){t&&(t.on(n.LOCAL_JOIN,(function(e){console.log("进入房间成功"),t.publishLocalVideo().then((function(){console.log("发布成功1")})),t.publishLocalAudio().then((function(){console.log("发布成功2")}))})),t.on(n.REMOTE_VIDEO_ADD,(function(e){console.log("视频流变动");var o=e.data.userID,n=e.data.streamType;t.subscribeRemoteVideo({userID:o,streamType:n})})),t.on(n.REMOTE_AUDIO_ADD,(function(e){console.log("音频变动’");var o=e.data.userID;t.subscribeRemoteAudio({userID:o})})),t.on(n.REMOTE_USER_JOIN,(function(o){console.log("* room REMOTE_USER_JOIN",o,t.getRemoteUserList()),e.timestamp.push(new Date)})),t.on(n.REMOTE_USER_LEAVE,(function(o){console.log("* room REMOTE_USER_LEAVE",o,t.getRemoteUserList()),"1v1"===e.template&&(e.timestamp=[]),"1v1"===e.template&&e.remoteUser===o.data.userID&&(e.remoteUser=null)})),t.on(n.REMOTE_VIDEO_ADD,(function(o){t.getRemoteUserList();var n=o.data;e.remoteUser=n.userID,t.subscribeRemoteVideo({userID:n.userID,streamType:n.streamType})})),t.on(n.ERROR,(function(e){console.log("* room ERROR",e)})),t.enterRoom({roomID:o.roomId}).catch((function(e){console.error("room joinRoom 进房失败:",e)})))}))}}};o.default=r},d671:function(e,o,t){"use strict";(function(e,o){var n=t("4ea4");t("2e1c");n(t("66fd"));var r=n(t("4cce"));e.__webpack_require_UNI_MP_PLUGIN__=t,o(r.default)}).call(this,t("bc2e")["default"],t("543d")["createPage"])}},[["d671","common/runtime","common/vendor"]]]);