108 lines
2.7 KiB
JavaScript
108 lines
2.7 KiB
JavaScript
import { TUICallKitServer } from "../../../TUICallService/index";
|
|
const PATH = '../../../static';
|
|
Component({
|
|
properties: {
|
|
callRole: {
|
|
type: String,
|
|
},
|
|
callStatus: {
|
|
type: String,
|
|
},
|
|
callMediaType: {
|
|
type: Number,
|
|
},
|
|
callDuration: {
|
|
type: String,
|
|
},
|
|
pusher: {
|
|
type: Object,
|
|
},
|
|
playerList: {
|
|
type: Array,
|
|
},
|
|
localUserInfo: {
|
|
type:Object
|
|
},
|
|
remoteUserInfoList: {
|
|
type: Array,
|
|
},
|
|
isEarPhone: {
|
|
type: Boolean,
|
|
},
|
|
bigScreenUserId: {
|
|
type: Boolean
|
|
}
|
|
},
|
|
data:{
|
|
IMG_DEFAULT_AVATAR:`${PATH}/default_avatar.png`,
|
|
IMG_HANGUP:`${PATH}/hangup.png`,
|
|
IMG_ACCEPT: `${PATH}/dialing.png`,
|
|
IMG_SPEAKER_FALSE:`${PATH}/speaker-false.png`,
|
|
IMG_SPEAKER_TRUE:`${PATH}/speaker-true.png`,
|
|
IMG_AUDIO_TRUE:`${PATH}/audio-true.png`,
|
|
IMG_AUDIO_FALSE:`${PATH}/audio-false.png`,
|
|
IMG_CAMERA_TRUE:`${PATH}/camera-true.png`,
|
|
IMG_CAMERA_FALSE:`${PATH}/camera-false.png`,
|
|
IMG_TRANS:`${PATH}/trans.png`,
|
|
IMG_SWITCH_CAMERA:`${PATH}/switch_camera.png`,
|
|
},
|
|
methods: {
|
|
async accept() {
|
|
await TUICallKitServer.accept();
|
|
},
|
|
async hangup() {
|
|
await TUICallKitServer.hangup();
|
|
},
|
|
async reject() {
|
|
await TUICallKitServer.reject();
|
|
},
|
|
async switchCamera() {
|
|
await TUICallKitServer.switchCamera();
|
|
},
|
|
async switchCallMediaType() {
|
|
await TUICallKitServer.switchCallMediaType();
|
|
},
|
|
async microPhoneHandler() {
|
|
if (this.data.localUserInfo.isAudioAvailable) {
|
|
await TUICallKitServer.closeMicrophone();
|
|
} else {
|
|
await TUICallKitServer.openMicrophone();
|
|
}
|
|
},
|
|
async cameraHandler() {
|
|
if (this.data.localUserInfo.isVideoAvailable) {
|
|
await TUICallKitServer.closeCamera();
|
|
} else {
|
|
await TUICallKitServer.openCamera();
|
|
}
|
|
},
|
|
async toggleSoundMode() {
|
|
await TUICallKitServer.setSoundMode();
|
|
},
|
|
toggleViewSize() {
|
|
TUICallKitServer.switchScreen(this.data.bigScreenUserId ? 'player':'localVideo')
|
|
},
|
|
pusherStateChangeHandler(e) {
|
|
TUICallKitServer._tuiCallEngine._pusherStateChangeHandler(e);
|
|
},
|
|
pusherNetStatus(e) {
|
|
TUICallKitServer._tuiCallEngine._pusherNetStatus(e);
|
|
},
|
|
pusherErrorHandler(e) {
|
|
TUICallKitServer._tuiCallEngine._pusherNetStatus(e);
|
|
},
|
|
pusherAudioVolumeNotify(e) {
|
|
TUICallKitServer._tuiCallEngine._pusherAudioVolumeNotify(e);
|
|
},
|
|
playerStateChange(e) {
|
|
TUICallKitServer._tuiCallEngine._playerStateChange(e);
|
|
},
|
|
playNetStatus(e) {
|
|
TUICallKitServer._tuiCallEngine._playNetStatus(e);
|
|
},
|
|
playerAudioVolumeNotify(e) {
|
|
TUICallKitServer._tuiCallEngine._playerAudioVolumeNotify(e);
|
|
},
|
|
},
|
|
});
|