|
|
|
@ -1,92 +1,296 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="csc-call">
|
|
|
|
|
<audio ref="incomingSound" loop preload="auto" src="statics/ring.mp3"></audio>
|
|
|
|
|
<q-card flat color="secondary">
|
|
|
|
|
<div :class="callClasses">
|
|
|
|
|
<audio
|
|
|
|
|
ref="incomingSound"
|
|
|
|
|
loop
|
|
|
|
|
preload="auto"
|
|
|
|
|
src="statics/ring.mp3"
|
|
|
|
|
></audio>
|
|
|
|
|
<q-card
|
|
|
|
|
flat
|
|
|
|
|
color="secondary"
|
|
|
|
|
>
|
|
|
|
|
<q-card-title>
|
|
|
|
|
|
|
|
|
|
<span v-if="isRinging || isInitiating || isIncoming">
|
|
|
|
|
<q-spinner-rings color="primary" :size="50" />
|
|
|
|
|
<q-spinner-rings
|
|
|
|
|
color="primary"
|
|
|
|
|
:size="50"
|
|
|
|
|
/>
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
<q-icon v-if="isPreparing" name="call" color="primary" size="26px"/>
|
|
|
|
|
<q-icon v-if="isEstablished && isCaller" name="call made" color="primary" size="26px"/>
|
|
|
|
|
<q-icon v-if="isEstablished && isCallee" name="call received" color="primary" size="26px"/>
|
|
|
|
|
<q-icon v-if="isEnded" name="error" color="primary" size="26px"/>
|
|
|
|
|
<q-icon
|
|
|
|
|
v-if="isPreparing"
|
|
|
|
|
name="call"
|
|
|
|
|
color="primary"
|
|
|
|
|
size="26px"
|
|
|
|
|
/>
|
|
|
|
|
<q-icon
|
|
|
|
|
v-if="isEstablished && isCaller"
|
|
|
|
|
name="call made"
|
|
|
|
|
color="primary"
|
|
|
|
|
size="26px"
|
|
|
|
|
/>
|
|
|
|
|
<q-icon
|
|
|
|
|
v-if="isEstablished && isCallee"
|
|
|
|
|
name="call received"
|
|
|
|
|
color="primary"
|
|
|
|
|
size="26px"
|
|
|
|
|
/>
|
|
|
|
|
<q-icon
|
|
|
|
|
v-if="isEnded"
|
|
|
|
|
name="error"
|
|
|
|
|
color="primary"
|
|
|
|
|
size="26px"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<span v-if="isPreparing" class="text">{{ $t('call.startNew') }}</span>
|
|
|
|
|
<span v-else-if="isInitiating" class="text">{{ $t('call.initiating') }}</span>
|
|
|
|
|
<span v-else-if="isRinging" class="text">{{ $t('call.ringing') }}</span>
|
|
|
|
|
<span v-else-if="isEnded" class="text">{{ $t('call.ended') }}</span>
|
|
|
|
|
<span v-else-if="isIncoming" class="text">{{ $t('call.incoming') }}</span>
|
|
|
|
|
<span v-else class="text">{{ $t('call.call') }}</span>
|
|
|
|
|
<span
|
|
|
|
|
v-if="isPreparing"
|
|
|
|
|
class="text"
|
|
|
|
|
>
|
|
|
|
|
{{ $t('call.startNew') }}
|
|
|
|
|
</span>
|
|
|
|
|
<span
|
|
|
|
|
v-else-if="isInitiating"
|
|
|
|
|
class="text"
|
|
|
|
|
>
|
|
|
|
|
{{ $t('call.initiating') }}
|
|
|
|
|
</span>
|
|
|
|
|
<span
|
|
|
|
|
v-else-if="isRinging"
|
|
|
|
|
class="text"
|
|
|
|
|
>
|
|
|
|
|
{{ $t('call.ringing') }}
|
|
|
|
|
</span>
|
|
|
|
|
<span
|
|
|
|
|
v-else-if="isEnded"
|
|
|
|
|
class="text"
|
|
|
|
|
>
|
|
|
|
|
{{ $t('call.ended') }}
|
|
|
|
|
</span>
|
|
|
|
|
<span
|
|
|
|
|
v-else-if="isIncoming"
|
|
|
|
|
class="text"
|
|
|
|
|
>
|
|
|
|
|
{{ $t('call.incoming') }}
|
|
|
|
|
</span>
|
|
|
|
|
<span
|
|
|
|
|
v-else
|
|
|
|
|
class="text"
|
|
|
|
|
>
|
|
|
|
|
{{ $t('call.call') }}
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
<q-btn v-if="isFullscreenEnabled && !isMobile" round :small="!isFullscreenEnabled" slot="right"
|
|
|
|
|
class="no-shadow" @click="toggleFullscreen()" icon="fullscreen exit"/>
|
|
|
|
|
<q-btn v-else-if="!isMobile" round :small="!isFullscreenEnabled" slot="right"
|
|
|
|
|
class="no-shadow" @click="toggleFullscreen()" icon="fullscreen"/>
|
|
|
|
|
<q-btn round :small="!isFullscreenEnabled" slot="right"
|
|
|
|
|
class="no-shadow" @click="close()" icon="clear"/>
|
|
|
|
|
<q-btn
|
|
|
|
|
v-if="isFullscreenEnabled && !isMobile"
|
|
|
|
|
round
|
|
|
|
|
:small="!isFullscreenEnabled"
|
|
|
|
|
slot="right"
|
|
|
|
|
class="no-shadow"
|
|
|
|
|
@click="toggleFullscreen()"
|
|
|
|
|
icon="fullscreen exit"
|
|
|
|
|
/>
|
|
|
|
|
<q-btn
|
|
|
|
|
v-else-if="!isMobile"
|
|
|
|
|
round
|
|
|
|
|
:small="!isFullscreenEnabled"
|
|
|
|
|
slot="right"
|
|
|
|
|
class="no-shadow"
|
|
|
|
|
@click="toggleFullscreen()"
|
|
|
|
|
icon="fullscreen"
|
|
|
|
|
/>
|
|
|
|
|
<q-btn
|
|
|
|
|
round
|
|
|
|
|
:small="!isFullscreenEnabled"
|
|
|
|
|
slot="right"
|
|
|
|
|
class="no-shadow"
|
|
|
|
|
@click="close()"
|
|
|
|
|
icon="clear"
|
|
|
|
|
/>
|
|
|
|
|
</q-card-title>
|
|
|
|
|
<q-card-main>
|
|
|
|
|
|
|
|
|
|
<q-alert v-if="desktopSharingInstall" v-model="desktopSharingInstall"
|
|
|
|
|
color="warning" :actions="desktopSharingAlertActions">
|
|
|
|
|
<q-alert
|
|
|
|
|
v-if="desktopSharingInstall"
|
|
|
|
|
v-model="desktopSharingInstall"
|
|
|
|
|
color="warning"
|
|
|
|
|
:actions="desktopSharingAlertActions"
|
|
|
|
|
>
|
|
|
|
|
{{ $t('call.desktopSharingNotInstalled') }}
|
|
|
|
|
</q-alert>
|
|
|
|
|
|
|
|
|
|
<div class="csc-call-info">
|
|
|
|
|
<q-field v-show="isPreparing" :helper="$t('call.inputNumber')" :count="64" dark
|
|
|
|
|
:error="validationEnabled && phoneNumberError" :error-label="$t('call.inputValidNumber')">
|
|
|
|
|
<q-input type="text" :float-label="$t('call.number')" :value="phoneNumber" @input="inputPhoneNumber"
|
|
|
|
|
ref="numberInput" dark clearable :max="64" @blur="phoneNumberBlur" @focus="phoneNumberFocus"
|
|
|
|
|
@keypress.space.prevent @keydown.space.prevent />
|
|
|
|
|
</q-field>
|
|
|
|
|
<div v-if="!isPreparing" class="phone-number">
|
|
|
|
|
<q-icon v-if="isCalling && (localMediaType == 'audioVideo' || remoteMediaType == 'audioVideo')"
|
|
|
|
|
name="videocam" color="primary" size="26px"/>
|
|
|
|
|
<q-icon v-else-if="isCalling && (localMediaType == 'audioOnly' || remoteMediaType == 'audioVideo')"
|
|
|
|
|
name="mic" color="primary" size="26px"/>
|
|
|
|
|
<csc-phone-number-input
|
|
|
|
|
ref="phoneNumberInput"
|
|
|
|
|
v-if="isPreparing"
|
|
|
|
|
:enabled="isPhoneNumberInputEnabled"
|
|
|
|
|
/>
|
|
|
|
|
<div
|
|
|
|
|
v-if="!isPreparing"
|
|
|
|
|
class="phone-number"
|
|
|
|
|
>
|
|
|
|
|
<q-icon
|
|
|
|
|
v-if="isCalling && (localMediaType == 'audioVideo' || remoteMediaType == 'audioVideo')"
|
|
|
|
|
name="videocam"
|
|
|
|
|
color="primary"
|
|
|
|
|
size="26px"
|
|
|
|
|
/>
|
|
|
|
|
<q-icon
|
|
|
|
|
v-else-if="isCalling && (localMediaType == 'audioOnly' || remoteMediaType == 'audioVideo')"
|
|
|
|
|
name="mic"
|
|
|
|
|
color="primary"
|
|
|
|
|
size="26px"
|
|
|
|
|
/>
|
|
|
|
|
{{ getNumber | destinationFormat }}
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="isEnded" class="ended-reason">{{ getEndedReason }}</div>
|
|
|
|
|
<div
|
|
|
|
|
v-if="isEnded"
|
|
|
|
|
class="ended-reason"
|
|
|
|
|
>
|
|
|
|
|
{{ getEndedReason }}
|
|
|
|
|
</div>
|
|
|
|
|
<csc-call-dialpad
|
|
|
|
|
class="csc-call-dialpad"
|
|
|
|
|
v-if="isDialpadEnabled"
|
|
|
|
|
@inserted="dialpadInserted"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="csc-call-media">
|
|
|
|
|
<csc-media :class="mediaPreviewClasses" id="local-media" :muted="true"
|
|
|
|
|
v-show="isCalling" :stream="localMediaStream" />
|
|
|
|
|
<csc-media class="csc-media-remote" id="remote-media" :muted="isMuted"
|
|
|
|
|
v-show="isEstablished" :stream="remoteMediaStream" />
|
|
|
|
|
<csc-media
|
|
|
|
|
:class="mediaPreviewClasses"
|
|
|
|
|
id="local-media"
|
|
|
|
|
:muted="true"
|
|
|
|
|
v-show="isCalling"
|
|
|
|
|
:stream="localMediaStream"
|
|
|
|
|
/>
|
|
|
|
|
<csc-media
|
|
|
|
|
class="csc-media-remote"
|
|
|
|
|
id="remote-media"
|
|
|
|
|
:muted="isMuted"
|
|
|
|
|
v-show="isEstablished"
|
|
|
|
|
:stream="remoteMediaStream"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</q-card-main>
|
|
|
|
|
<q-card-actions align="center">
|
|
|
|
|
<q-btn v-if="isEstablished" round :small="!isFullscreenEnabled" color="primary" @click="toggleAudio()" :icon="toggleAudioIcon" />
|
|
|
|
|
<q-btn v-if="isEstablished && localMediaType == 'audioVideo'" round :small="!isFullscreenEnabled" color="primary" @click="toggleVideo()" :icon="toggleVideoIcon" />
|
|
|
|
|
<q-btn v-if="isEstablished" round :small="!isFullscreenEnabled" color="primary" @click="toggleMute()" :icon="toggleMuteIcon" />
|
|
|
|
|
<q-btn v-if="isPreparing" round :small="!isFullscreenEnabled" color="primary" @click="call('audioOnly')" icon="mic" />
|
|
|
|
|
<q-btn v-if="isPreparing" round :small="!isFullscreenEnabled" color="primary" @click="call('audioVideo')" icon="videocam" />
|
|
|
|
|
<q-btn v-if="isPreparing && !isMobile" round :small="!isFullscreenEnabled" color="primary" @click="call('audioScreen')" icon="computer" />
|
|
|
|
|
<q-btn v-if="isCalling" round :small="!isFullscreenEnabled" color="negative" @click="hangUp()" icon="call end" />
|
|
|
|
|
<q-btn v-if="isEnded" round :small="!isFullscreenEnabled" color="negative" @click="init()" icon="clear"/>
|
|
|
|
|
<q-btn v-if="isIncoming" round :small="!isFullscreenEnabled" color="primary" @click="accept('audioOnly')" icon="mic" />
|
|
|
|
|
<q-btn v-if="isIncoming" round :small="!isFullscreenEnabled" color="primary" @click="accept('audioVideo')" icon="videocam" />
|
|
|
|
|
<q-btn v-if="isIncoming && !isMobile" round :small="!isFullscreenEnabled" color="primary" @click="accept('audioScreen')" icon="computer" />
|
|
|
|
|
<q-btn v-if="isIncoming" round :small="!isFullscreenEnabled" color="negative" @click="decline()" icon="call end" />
|
|
|
|
|
<q-btn
|
|
|
|
|
v-if="isEstablished"
|
|
|
|
|
round
|
|
|
|
|
:small="!isFullscreenEnabled"
|
|
|
|
|
color="primary"
|
|
|
|
|
@click="toggleAudio()"
|
|
|
|
|
:icon="toggleAudioIcon"
|
|
|
|
|
/>
|
|
|
|
|
<q-btn
|
|
|
|
|
v-if="isEstablished && localMediaType == 'audioVideo'"
|
|
|
|
|
round
|
|
|
|
|
:small="!isFullscreenEnabled"
|
|
|
|
|
color="primary"
|
|
|
|
|
@click="toggleVideo()"
|
|
|
|
|
:icon="toggleVideoIcon"
|
|
|
|
|
/>
|
|
|
|
|
<q-btn
|
|
|
|
|
v-if="isEstablished"
|
|
|
|
|
round
|
|
|
|
|
:small="!isFullscreenEnabled"
|
|
|
|
|
color="primary"
|
|
|
|
|
@click="toggleMute()"
|
|
|
|
|
:icon="toggleMuteIcon"
|
|
|
|
|
/>
|
|
|
|
|
<q-btn
|
|
|
|
|
v-if="isPreparing"
|
|
|
|
|
round
|
|
|
|
|
:small="!isFullscreenEnabled"
|
|
|
|
|
color="primary"
|
|
|
|
|
@click="call('audioOnly')"
|
|
|
|
|
icon="mic"
|
|
|
|
|
/>
|
|
|
|
|
<q-btn
|
|
|
|
|
v-if="isPreparing"
|
|
|
|
|
round
|
|
|
|
|
:small="!isFullscreenEnabled"
|
|
|
|
|
color="primary"
|
|
|
|
|
@click="call('audioVideo')"
|
|
|
|
|
icon="videocam"
|
|
|
|
|
/>
|
|
|
|
|
<q-btn
|
|
|
|
|
v-if="isPreparing && !isMobile"
|
|
|
|
|
round
|
|
|
|
|
:small="!isFullscreenEnabled"
|
|
|
|
|
color="primary"
|
|
|
|
|
@click="call('audioScreen')"
|
|
|
|
|
icon="computer"
|
|
|
|
|
/>
|
|
|
|
|
<q-btn
|
|
|
|
|
v-if="isCalling"
|
|
|
|
|
round
|
|
|
|
|
:small="!isFullscreenEnabled"
|
|
|
|
|
color="negative"
|
|
|
|
|
@click="hangUp()"
|
|
|
|
|
icon="call end"
|
|
|
|
|
/>
|
|
|
|
|
<q-btn
|
|
|
|
|
v-if="isEnded"
|
|
|
|
|
round
|
|
|
|
|
:small="!isFullscreenEnabled"
|
|
|
|
|
color="negative"
|
|
|
|
|
@click="init()"
|
|
|
|
|
icon="clear"
|
|
|
|
|
/>
|
|
|
|
|
<q-btn
|
|
|
|
|
v-if="isIncoming"
|
|
|
|
|
round
|
|
|
|
|
:small="!isFullscreenEnabled"
|
|
|
|
|
color="primary"
|
|
|
|
|
@click="accept('audioOnly')"
|
|
|
|
|
icon="mic"
|
|
|
|
|
/>
|
|
|
|
|
<q-btn
|
|
|
|
|
v-if="isIncoming"
|
|
|
|
|
round
|
|
|
|
|
:small="!isFullscreenEnabled"
|
|
|
|
|
color="primary"
|
|
|
|
|
@click="accept('audioVideo')"
|
|
|
|
|
icon="videocam"
|
|
|
|
|
/>
|
|
|
|
|
<q-btn
|
|
|
|
|
v-if="isIncoming && !isMobile"
|
|
|
|
|
round
|
|
|
|
|
:small="!isFullscreenEnabled"
|
|
|
|
|
color="primary"
|
|
|
|
|
@click="accept('audioScreen')"
|
|
|
|
|
icon="computer"
|
|
|
|
|
/>
|
|
|
|
|
<q-btn
|
|
|
|
|
v-if="isDialpadButtonEnabled"
|
|
|
|
|
round
|
|
|
|
|
:small="!isFullscreenEnabled"
|
|
|
|
|
color="primary"
|
|
|
|
|
@click="toggleDialpad()"
|
|
|
|
|
icon="dialpad"
|
|
|
|
|
/>
|
|
|
|
|
<q-btn
|
|
|
|
|
v-if="isIncoming"
|
|
|
|
|
round
|
|
|
|
|
:small="!isFullscreenEnabled"
|
|
|
|
|
color="negative"
|
|
|
|
|
@click="decline()"
|
|
|
|
|
icon="call end"
|
|
|
|
|
/>
|
|
|
|
|
</q-card-actions>
|
|
|
|
|
</q-card>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import Vue from 'vue';
|
|
|
|
|
import _ from 'lodash';
|
|
|
|
|
import platformMixin from '../mixins/platform'
|
|
|
|
|
import { mapGetters } from 'vuex'
|
|
|
|
|
import CscMedia from './CscMedia'
|
|
|
|
|
import { normalizeNumber, rawNumber } from '../filters/number-format'
|
|
|
|
|
import numberFormat from '../filters/number-format'
|
|
|
|
|
import { showCallNotification } from '../helpers/ui'
|
|
|
|
|
import { getChromeExtensionUrl } from '../helpers/cdk-lib'
|
|
|
|
|
import CscCallDialpad from './CscCallDialpad'
|
|
|
|
|
import CscPhoneNumberInput from './call/CscPhoneNumberInput'
|
|
|
|
|
import {
|
|
|
|
|
QLayout,
|
|
|
|
|
QCard,
|
|
|
|
@ -100,7 +304,6 @@
|
|
|
|
|
QIcon,
|
|
|
|
|
QSpinnerRings,
|
|
|
|
|
Dialog,
|
|
|
|
|
Platform,
|
|
|
|
|
QAlert
|
|
|
|
|
} from 'quasar-framework'
|
|
|
|
|
|
|
|
|
@ -111,9 +314,13 @@
|
|
|
|
|
return {
|
|
|
|
|
phoneNumber: '',
|
|
|
|
|
phoneNumberError: false,
|
|
|
|
|
validationEnabled: false
|
|
|
|
|
validationEnabled: false,
|
|
|
|
|
dialpadEnabled: false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mixins: [
|
|
|
|
|
platformMixin
|
|
|
|
|
],
|
|
|
|
|
components: {
|
|
|
|
|
QLayout,
|
|
|
|
|
QCard,
|
|
|
|
@ -127,19 +334,27 @@
|
|
|
|
|
QIcon,
|
|
|
|
|
QSpinnerRings,
|
|
|
|
|
CscMedia,
|
|
|
|
|
QAlert
|
|
|
|
|
QAlert,
|
|
|
|
|
CscCallDialpad,
|
|
|
|
|
CscPhoneNumberInput
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.dialpadEnabled = this.isMobile;
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
inputPhoneNumber(value) {
|
|
|
|
|
this.phoneNumber = normalizeNumber(value, Platform.is.mobile);
|
|
|
|
|
dialpadInserted(value) {
|
|
|
|
|
if(this.isEstablished) {
|
|
|
|
|
this.$store.dispatch('call/sendDTMF', value);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
this.$refs.phoneNumberInput.concat(value);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
focusNumberInput() {
|
|
|
|
|
Vue.nextTick(() => {
|
|
|
|
|
this.$refs.numberInput.focus();
|
|
|
|
|
});
|
|
|
|
|
this.$refs.phoneNumberInput.focusInput();
|
|
|
|
|
},
|
|
|
|
|
blurNumberInput() {
|
|
|
|
|
this.$refs.numberInput.blur();
|
|
|
|
|
this.$refs.phoneNumberInput.blurInput();
|
|
|
|
|
},
|
|
|
|
|
init() {
|
|
|
|
|
this.phoneNumber = '';
|
|
|
|
@ -154,17 +369,12 @@
|
|
|
|
|
this.validationEnabled = false;
|
|
|
|
|
},
|
|
|
|
|
call(localMedia) {
|
|
|
|
|
this.validationEnabled = true;
|
|
|
|
|
if(!_.isEmpty(this.phoneNumber)) {
|
|
|
|
|
this.phoneNumberError = false;
|
|
|
|
|
if(this.$refs.phoneNumberInput.hasPhoneNumber()) {
|
|
|
|
|
this.$store.dispatch('call/start', {
|
|
|
|
|
number: rawNumber(this.phoneNumber),
|
|
|
|
|
number: this.$refs.phoneNumberInput.getRawPhoneNumber(),
|
|
|
|
|
localMedia: localMedia
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
this.phoneNumberError = true;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
accept(localMedia) {
|
|
|
|
|
this.$store.dispatch('call/accept', localMedia);
|
|
|
|
@ -200,10 +410,10 @@
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
playIncomingSound() {
|
|
|
|
|
this.$refs.incomingRinging.play();
|
|
|
|
|
this.$refs.incomingSound.play();
|
|
|
|
|
},
|
|
|
|
|
stopIncomingSound() {
|
|
|
|
|
this.$refs.incomingRinging.stop();
|
|
|
|
|
this.$refs.incomingSound.pause();
|
|
|
|
|
},
|
|
|
|
|
toggleAudio() {
|
|
|
|
|
if(this.isAudioEnabled) {
|
|
|
|
@ -231,6 +441,9 @@
|
|
|
|
|
},
|
|
|
|
|
toggleFullscreen() {
|
|
|
|
|
this.$emit('fullscreen');
|
|
|
|
|
},
|
|
|
|
|
toggleDialpad() {
|
|
|
|
|
this.dialpadEnabled = !this.dialpadEnabled;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
@ -268,16 +481,6 @@
|
|
|
|
|
}
|
|
|
|
|
return classes;
|
|
|
|
|
},
|
|
|
|
|
// formattedPhoneNumber: {
|
|
|
|
|
// get() {
|
|
|
|
|
// return normalizeNumber(this.phoneNumber);
|
|
|
|
|
// },
|
|
|
|
|
// set(value) {
|
|
|
|
|
// this.validationEnabled = true;
|
|
|
|
|
// this.phoneNumberError = false;
|
|
|
|
|
// this.phoneNumber = rawNumber(value);
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
localMediaStream() {
|
|
|
|
|
if(this.$store.state.call.localMediaStream !== null) {
|
|
|
|
|
return this.$store.state.call.localMediaStream.getStream();
|
|
|
|
@ -317,9 +520,6 @@
|
|
|
|
|
'callState',
|
|
|
|
|
'desktopSharingInstall'
|
|
|
|
|
]),
|
|
|
|
|
isMobile() {
|
|
|
|
|
return Platform.is.mobile;
|
|
|
|
|
},
|
|
|
|
|
desktopSharingAlertActions() {
|
|
|
|
|
var self = this;
|
|
|
|
|
return [
|
|
|
|
@ -337,30 +537,45 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
isPhoneNumberInputEnabled () {
|
|
|
|
|
return !(this.isDialpadEnabled && this.isMobile);
|
|
|
|
|
},
|
|
|
|
|
isDialpadEnabled() {
|
|
|
|
|
return this.dialpadEnabled && (this.isPreparing || this.isEstablished);
|
|
|
|
|
},
|
|
|
|
|
isDialpadButtonEnabled() {
|
|
|
|
|
return this.isPreparing || this.isEstablished;
|
|
|
|
|
},
|
|
|
|
|
callClasses() {
|
|
|
|
|
let callClasses = ['csc-call'];
|
|
|
|
|
if(this.isEstablished) {
|
|
|
|
|
callClasses.push('csc-call-established');
|
|
|
|
|
}
|
|
|
|
|
return callClasses;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
callState(state) {
|
|
|
|
|
if(state === 'incoming') {
|
|
|
|
|
showCallNotification(numberFormat(this.getNumber));
|
|
|
|
|
this.$refs.incomingSound.play();
|
|
|
|
|
}
|
|
|
|
|
else if (state === 'input') {
|
|
|
|
|
this.focusNumberInput();
|
|
|
|
|
this.$refs.incomingSound.pause();
|
|
|
|
|
this.playIncomingSound();
|
|
|
|
|
}
|
|
|
|
|
else if (state === 'ringing') {
|
|
|
|
|
this.$refs.incomingSound.play();
|
|
|
|
|
this.playIncomingSound();
|
|
|
|
|
}
|
|
|
|
|
else if (state === 'input') {
|
|
|
|
|
this.stopIncomingSound();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
this.$refs.incomingSound.pause();
|
|
|
|
|
this.stopIncomingSound();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="stylus">
|
|
|
|
|
<style lang="stylus" rel="stylesheet/stylus">
|
|
|
|
|
@import '../themes/quasar.variables.styl';
|
|
|
|
|
|
|
|
|
|
.csc-call {
|
|
|
|
@ -430,4 +645,9 @@
|
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.csc-call.csc-call-established
|
|
|
|
|
.csc-call-dialpad
|
|
|
|
|
padding-top 0
|
|
|
|
|
padding-bottom 16px
|
|
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|