|
|
@ -5,6 +5,7 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
import IS_SCREEN_SHARING_SUPPORTED from "../../environment/screenSharingSupport"; |
|
|
|
import IS_SCREEN_SHARING_SUPPORTED from "../../environment/screenSharingSupport"; |
|
|
|
|
|
|
|
import { IS_MOBILE } from "../../environment/userAgent"; |
|
|
|
import { attachClickEvent } from "../../helpers/dom/clickEvent"; |
|
|
|
import { attachClickEvent } from "../../helpers/dom/clickEvent"; |
|
|
|
import ControlsHover from "../../helpers/dom/controlsHover"; |
|
|
|
import ControlsHover from "../../helpers/dom/controlsHover"; |
|
|
|
import findUpClassName from "../../helpers/dom/findUpClassName"; |
|
|
|
import findUpClassName from "../../helpers/dom/findUpClassName"; |
|
|
@ -14,6 +15,7 @@ import MovablePanel from "../../helpers/movablePanel"; |
|
|
|
import safeAssign from "../../helpers/object/safeAssign"; |
|
|
|
import safeAssign from "../../helpers/object/safeAssign"; |
|
|
|
import toggleClassName from "../../helpers/toggleClassName"; |
|
|
|
import toggleClassName from "../../helpers/toggleClassName"; |
|
|
|
import type { AppAvatarsManager } from "../../lib/appManagers/appAvatarsManager"; |
|
|
|
import type { AppAvatarsManager } from "../../lib/appManagers/appAvatarsManager"; |
|
|
|
|
|
|
|
import type { AppCallsManager } from "../../lib/appManagers/appCallsManager"; |
|
|
|
import type { AppPeersManager } from "../../lib/appManagers/appPeersManager"; |
|
|
|
import type { AppPeersManager } from "../../lib/appManagers/appPeersManager"; |
|
|
|
import CallInstance from "../../lib/calls/callInstance"; |
|
|
|
import CallInstance from "../../lib/calls/callInstance"; |
|
|
|
import CALL_STATE from "../../lib/calls/callState"; |
|
|
|
import CALL_STATE from "../../lib/calls/callState"; |
|
|
@ -21,6 +23,7 @@ import I18n, { i18n } from "../../lib/langPack"; |
|
|
|
import RichTextProcessor from "../../lib/richtextprocessor"; |
|
|
|
import RichTextProcessor from "../../lib/richtextprocessor"; |
|
|
|
import rootScope from "../../lib/rootScope"; |
|
|
|
import rootScope from "../../lib/rootScope"; |
|
|
|
import animationIntersector from "../animationIntersector"; |
|
|
|
import animationIntersector from "../animationIntersector"; |
|
|
|
|
|
|
|
import AvatarElement from "../avatar"; |
|
|
|
import ButtonIcon from "../buttonIcon"; |
|
|
|
import ButtonIcon from "../buttonIcon"; |
|
|
|
import GroupCallMicrophoneIconMini from "../groupCall/microphoneIconMini"; |
|
|
|
import GroupCallMicrophoneIconMini from "../groupCall/microphoneIconMini"; |
|
|
|
import { MovableState } from "../movableElement"; |
|
|
|
import { MovableState } from "../movableElement"; |
|
|
@ -40,6 +43,7 @@ let previousState: MovableState = { |
|
|
|
|
|
|
|
|
|
|
|
export default class PopupCall extends PopupElement { |
|
|
|
export default class PopupCall extends PopupElement { |
|
|
|
private instance: CallInstance; |
|
|
|
private instance: CallInstance; |
|
|
|
|
|
|
|
private appCallsManager: AppCallsManager; |
|
|
|
private appAvatarsManager: AppAvatarsManager; |
|
|
|
private appAvatarsManager: AppAvatarsManager; |
|
|
|
private appPeersManager: AppPeersManager; |
|
|
|
private appPeersManager: AppPeersManager; |
|
|
|
private peerId: PeerId; |
|
|
|
private peerId: PeerId; |
|
|
@ -76,6 +80,7 @@ export default class PopupCall extends PopupElement { |
|
|
|
private controlsHover: ControlsHover; |
|
|
|
private controlsHover: ControlsHover; |
|
|
|
|
|
|
|
|
|
|
|
constructor(options: { |
|
|
|
constructor(options: { |
|
|
|
|
|
|
|
appCallsManager: AppCallsManager, |
|
|
|
appAvatarsManager: AppAvatarsManager, |
|
|
|
appAvatarsManager: AppAvatarsManager, |
|
|
|
appPeersManager: AppPeersManager, |
|
|
|
appPeersManager: AppPeersManager, |
|
|
|
instance: CallInstance |
|
|
|
instance: CallInstance |
|
|
@ -96,8 +101,11 @@ export default class PopupCall extends PopupElement { |
|
|
|
avatarContainer.classList.add(className + '-avatar'); |
|
|
|
avatarContainer.classList.add(className + '-avatar'); |
|
|
|
|
|
|
|
|
|
|
|
const peerId = this.peerId = this.instance.interlocutorUserId.toPeerId(); |
|
|
|
const peerId = this.peerId = this.instance.interlocutorUserId.toPeerId(); |
|
|
|
const photo = this.appPeersManager.getPeerPhoto(peerId); |
|
|
|
const avatar = new AvatarElement(); |
|
|
|
this.appAvatarsManager.putAvatar(avatarContainer, peerId, photo, 'photo_big'); |
|
|
|
avatar.isBig = true; |
|
|
|
|
|
|
|
avatar.setAttribute('peer', '' + peerId); |
|
|
|
|
|
|
|
avatar.classList.add('avatar-full'); |
|
|
|
|
|
|
|
avatarContainer.append(avatar); |
|
|
|
|
|
|
|
|
|
|
|
const title = new PeerTitle({ |
|
|
|
const title = new PeerTitle({ |
|
|
|
peerId |
|
|
|
peerId |
|
|
@ -113,8 +121,9 @@ export default class PopupCall extends PopupElement { |
|
|
|
const emojisSubtitle = this.emojisSubtitle = document.createElement('div'); |
|
|
|
const emojisSubtitle = this.emojisSubtitle = document.createElement('div'); |
|
|
|
emojisSubtitle.classList.add(className + '-emojis'); |
|
|
|
emojisSubtitle.classList.add(className + '-emojis'); |
|
|
|
|
|
|
|
|
|
|
|
container.append(avatarContainer, title, subtitle, emojisSubtitle); |
|
|
|
container.append(avatarContainer, title, subtitle); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!IS_MOBILE) { |
|
|
|
this.btnFullScreen = ButtonIcon('fullscreen'); |
|
|
|
this.btnFullScreen = ButtonIcon('fullscreen'); |
|
|
|
this.btnExitFullScreen = ButtonIcon('smallscreen hide'); |
|
|
|
this.btnExitFullScreen = ButtonIcon('smallscreen hide'); |
|
|
|
attachClickEvent(this.btnFullScreen, this.onFullScreenClick, {listenerSetter}); |
|
|
|
attachClickEvent(this.btnFullScreen, this.onFullScreenClick, {listenerSetter}); |
|
|
@ -123,12 +132,17 @@ export default class PopupCall extends PopupElement { |
|
|
|
this.header.prepend(this.btnExitFullScreen); |
|
|
|
this.header.prepend(this.btnExitFullScreen); |
|
|
|
this.header.append(this.btnFullScreen); |
|
|
|
this.header.append(this.btnFullScreen); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
container.append(emojisSubtitle); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.header.append(emojisSubtitle); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.partyStates = document.createElement('div'); |
|
|
|
this.partyStates = document.createElement('div'); |
|
|
|
this.partyStates.classList.add(className + '-party-states'); |
|
|
|
this.partyStates.classList.add(className + '-party-states'); |
|
|
|
|
|
|
|
|
|
|
|
this.partyMutedState = document.createElement('div'); |
|
|
|
this.partyMutedState = document.createElement('div'); |
|
|
|
this.partyMutedState.classList.add(className + '-party-state'); |
|
|
|
this.partyMutedState.classList.add(className + '-party-state'); |
|
|
|
const stateText = i18n('VoipUserMicrophoneIsOff', [new PeerTitle({peerId, onlyFirstName: true}).element]); |
|
|
|
const stateText = i18n('VoipUserMicrophoneIsOff', [new PeerTitle({peerId, onlyFirstName: true, limitSymbols: 18}).element]); |
|
|
|
stateText.classList.add(className + '-party-state-text'); |
|
|
|
stateText.classList.add(className + '-party-state-text'); |
|
|
|
const mutedIcon = new GroupCallMicrophoneIconMini(false, true); |
|
|
|
const mutedIcon = new GroupCallMicrophoneIconMini(false, true); |
|
|
|
mutedIcon.setState(false, false); |
|
|
|
mutedIcon.setState(false, false); |
|
|
@ -193,6 +207,10 @@ export default class PopupCall extends PopupElement { |
|
|
|
this.updateInstance(); |
|
|
|
this.updateInstance(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public getCallInstance() { |
|
|
|
|
|
|
|
return this.instance; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private constructFirstButtons() { |
|
|
|
private constructFirstButtons() { |
|
|
|
const buttons = this.firstButtonsRow = document.createElement('div'); |
|
|
|
const buttons = this.firstButtonsRow = document.createElement('div'); |
|
|
|
buttons.classList.add(className + '-buttons', 'is-first'); |
|
|
|
buttons.classList.add(className + '-buttons', 'is-first'); |
|
|
@ -260,7 +278,7 @@ export default class PopupCall extends PopupElement { |
|
|
|
|
|
|
|
|
|
|
|
const btnAccept = this.btnAccept = this.makeButton({ |
|
|
|
const btnAccept = this.btnAccept = this.makeButton({ |
|
|
|
text: 'Call.Accept', |
|
|
|
text: 'Call.Accept', |
|
|
|
icon: 'phone', |
|
|
|
icon: 'phone_filled', |
|
|
|
callback: () => { |
|
|
|
callback: () => { |
|
|
|
this.instance.acceptCall(); |
|
|
|
this.instance.acceptCall(); |
|
|
|
}, |
|
|
|
}, |
|
|
|