|
|
@ -80,6 +80,7 @@ import fixSafariStickyInputFocusing, { IS_STICKY_INPUT_BUGGED } from '../../help |
|
|
|
import { copy } from '../../helpers/object'; |
|
|
|
import { copy } from '../../helpers/object'; |
|
|
|
import PopupPeer from '../popups/peer'; |
|
|
|
import PopupPeer from '../popups/peer'; |
|
|
|
import MEDIA_MIME_TYPES_SUPPORTED from '../../environment/mediaMimeTypesSupport'; |
|
|
|
import MEDIA_MIME_TYPES_SUPPORTED from '../../environment/mediaMimeTypesSupport'; |
|
|
|
|
|
|
|
import appMediaPlaybackController from '../appMediaPlaybackController'; |
|
|
|
|
|
|
|
|
|
|
|
const RECORD_MIN_TIME = 500; |
|
|
|
const RECORD_MIN_TIME = 500; |
|
|
|
const POSTING_MEDIA_NOT_ALLOWED = 'Posting media content isn\'t allowed in this group.'; |
|
|
|
const POSTING_MEDIA_NOT_ALLOWED = 'Posting media content isn\'t allowed in this group.'; |
|
|
@ -177,6 +178,8 @@ export default class ChatInput { |
|
|
|
|
|
|
|
|
|
|
|
private previousQuery: string; |
|
|
|
private previousQuery: string; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private releaseMediaPlayback: () => void; |
|
|
|
|
|
|
|
|
|
|
|
constructor(private chat: Chat, |
|
|
|
constructor(private chat: Chat, |
|
|
|
private appMessagesManager: AppMessagesManager, |
|
|
|
private appMessagesManager: AppMessagesManager, |
|
|
|
private appMessagesIdsManager: AppMessagesIdsManager, |
|
|
|
private appMessagesIdsManager: AppMessagesIdsManager, |
|
|
@ -575,6 +578,11 @@ export default class ChatInput { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
this.recorder.ondataavailable = (typedArray: Uint8Array) => { |
|
|
|
this.recorder.ondataavailable = (typedArray: Uint8Array) => { |
|
|
|
|
|
|
|
if(this.releaseMediaPlayback) { |
|
|
|
|
|
|
|
this.releaseMediaPlayback(); |
|
|
|
|
|
|
|
this.releaseMediaPlayback = undefined; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(this.recordingOverlayListener) { |
|
|
|
if(this.recordingOverlayListener) { |
|
|
|
this.listenerSetter.remove(this.recordingOverlayListener); |
|
|
|
this.listenerSetter.remove(this.recordingOverlayListener); |
|
|
|
this.recordingOverlayListener = undefined; |
|
|
|
this.recordingOverlayListener = undefined; |
|
|
@ -1455,7 +1463,9 @@ export default class ChatInput { |
|
|
|
|
|
|
|
|
|
|
|
this.chatInput.classList.add('is-locked'); |
|
|
|
this.chatInput.classList.add('is-locked'); |
|
|
|
blurActiveElement(); |
|
|
|
blurActiveElement(); |
|
|
|
|
|
|
|
|
|
|
|
this.recorder.start().then(() => { |
|
|
|
this.recorder.start().then(() => { |
|
|
|
|
|
|
|
this.releaseMediaPlayback = appMediaPlaybackController.setSingleMedia(); |
|
|
|
this.recordCanceled = false; |
|
|
|
this.recordCanceled = false; |
|
|
|
|
|
|
|
|
|
|
|
this.chatInput.classList.add('is-recording'); |
|
|
|
this.chatInput.classList.add('is-recording'); |
|
|
|