This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1472,5 +1472,61 @@
|
||||
"description": "Marker indicating that the message was edited",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_add_image": {
|
||||
"translation": "Bild hinzufügen",
|
||||
"defaultMessage": "Add image",
|
||||
"description": "Icon tool tip for attaching an image",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_attach_file": {
|
||||
"translation": "Datei anhängen",
|
||||
"defaultMessage": "Attach file",
|
||||
"description": "Icon tool tip for attaching a file",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_delete": {
|
||||
"translation": "Aufnahme löschen",
|
||||
"defaultMessage": "Delete recording",
|
||||
"description": "Icon tool tip for deleting recorded audio",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_pause": {
|
||||
"translation": "Wiedergabe pausieren",
|
||||
"defaultMessage": "Pause playback",
|
||||
"description": "Icon tool tip for pausing audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_play": {
|
||||
"translation": "Aufnahme abspielen",
|
||||
"defaultMessage": "Play recording",
|
||||
"description": "Icon tool tip for starting audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_record_voice": {
|
||||
"translation": "Sprachnachricht aufnehmen",
|
||||
"defaultMessage": "Record voice message",
|
||||
"description": "Icon tool tip for recording a voice message",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_resume": {
|
||||
"translation": "Wiedergabe fortsetzen",
|
||||
"defaultMessage": "Resume playback",
|
||||
"description": "Icon tool tip for resuming audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_send": {
|
||||
"translation": "Nachricht senden",
|
||||
"defaultMessage": "Send message",
|
||||
"description": "Icon tool tip for sending a message",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1472,5 +1472,61 @@
|
||||
"description": "Marker indicating that the message was edited",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_add_image": {
|
||||
"translation": "Add image",
|
||||
"defaultMessage": "Add image",
|
||||
"description": "Icon tool tip for attaching an image",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_attach_file": {
|
||||
"translation": "Attach file",
|
||||
"defaultMessage": "Attach file",
|
||||
"description": "Icon tool tip for attaching a file",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_delete": {
|
||||
"translation": "Delete",
|
||||
"defaultMessage": "Delete recording",
|
||||
"description": "Icon tool tip for deleting recorded audio",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_pause": {
|
||||
"translation": "Pause",
|
||||
"defaultMessage": "Pause playback",
|
||||
"description": "Icon tool tip for pausing audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_play": {
|
||||
"translation": "Play",
|
||||
"defaultMessage": "Play recording",
|
||||
"description": "Icon tool tip for starting audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_record_voice": {
|
||||
"translation": "Record voice message",
|
||||
"defaultMessage": "Record voice message",
|
||||
"description": "Icon tool tip for recording a voice message",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_resume": {
|
||||
"translation": "Resume",
|
||||
"defaultMessage": "Resume playback",
|
||||
"description": "Icon tool tip for resuming audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_send": {
|
||||
"translation": "Send message",
|
||||
"defaultMessage": "Send message",
|
||||
"description": "Icon tool tip for sending a message",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1472,5 +1472,61 @@
|
||||
"description": "Marker indicating that the message was edited",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_add_image": {
|
||||
"translation": "Añadir imagen",
|
||||
"defaultMessage": "Add image",
|
||||
"description": "Icon tool tip for attaching an image",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_attach_file": {
|
||||
"translation": "Adjuntar archivo",
|
||||
"defaultMessage": "Attach file",
|
||||
"description": "Icon tool tip for attaching a file",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_delete": {
|
||||
"translation": "Eliminar grabación",
|
||||
"defaultMessage": "Delete recording",
|
||||
"description": "Icon tool tip for deleting recorded audio",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_pause": {
|
||||
"translation": "Pausar reproducción",
|
||||
"defaultMessage": "Pause playback",
|
||||
"description": "Icon tool tip for pausing audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_play": {
|
||||
"translation": "Reproducir grabación",
|
||||
"defaultMessage": "Play recording",
|
||||
"description": "Icon tool tip for starting audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_record_voice": {
|
||||
"translation": "Grabar mensaje de voz",
|
||||
"defaultMessage": "Record voice message",
|
||||
"description": "Icon tool tip for recording a voice message",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_resume": {
|
||||
"translation": "Reanudar la reproducción",
|
||||
"defaultMessage": "Resume playback",
|
||||
"description": "Icon tool tip for resuming audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_send": {
|
||||
"translation": "Enviar mensaje",
|
||||
"defaultMessage": "Send message",
|
||||
"description": "Icon tool tip for sending a message",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -298,6 +298,38 @@
|
||||
"defaultMessage": "Group or User ID",
|
||||
"description": "Prompt for entering user or group ID"
|
||||
},
|
||||
"icon_title_add_image": {
|
||||
"defaultMessage": "Add image",
|
||||
"description": "Icon tool tip for attaching an image"
|
||||
},
|
||||
"icon_title_attach_file": {
|
||||
"defaultMessage": "Attach file",
|
||||
"description": "Icon tool tip for attaching a file"
|
||||
},
|
||||
"icon_title_delete": {
|
||||
"defaultMessage": "Delete recording",
|
||||
"description": "Icon tool tip for deleting recorded audio"
|
||||
},
|
||||
"icon_title_pause": {
|
||||
"defaultMessage": "Pause playback",
|
||||
"description": "Icon tool tip for pausing audio playback"
|
||||
},
|
||||
"icon_title_play": {
|
||||
"defaultMessage": "Play recording",
|
||||
"description": "Icon tool tip for starting audio playback"
|
||||
},
|
||||
"icon_title_record_voice": {
|
||||
"defaultMessage": "Record voice message",
|
||||
"description": "Icon tool tip for recording a voice message"
|
||||
},
|
||||
"icon_title_resume": {
|
||||
"defaultMessage": "Resume playback",
|
||||
"description": "Icon tool tip for resuming audio playback"
|
||||
},
|
||||
"icon_title_send": {
|
||||
"defaultMessage": "Send message",
|
||||
"description": "Icon tool tip for sending a message"
|
||||
},
|
||||
"image_caption_prompt": {
|
||||
"defaultMessage": "Image caption",
|
||||
"description": "Prompt in SendMessage for attached image"
|
||||
|
||||
@@ -1472,5 +1472,61 @@
|
||||
"description": "Marker indicating that the message was edited",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_add_image": {
|
||||
"translation": "Ajouter une image",
|
||||
"defaultMessage": "Add image",
|
||||
"description": "Icon tool tip for attaching an image",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_attach_file": {
|
||||
"translation": "Pièce jointe",
|
||||
"defaultMessage": "Attach file",
|
||||
"description": "Icon tool tip for attaching a file",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_delete": {
|
||||
"translation": "Supprimer l'enregistrement",
|
||||
"defaultMessage": "Delete recording",
|
||||
"description": "Icon tool tip for deleting recorded audio",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_pause": {
|
||||
"translation": "Interrompre la lecture",
|
||||
"defaultMessage": "Pause playback",
|
||||
"description": "Icon tool tip for pausing audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_play": {
|
||||
"translation": "Lire l'enregistrement",
|
||||
"defaultMessage": "Play recording",
|
||||
"description": "Icon tool tip for starting audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_record_voice": {
|
||||
"translation": "Enregistrer un message vocal",
|
||||
"defaultMessage": "Record voice message",
|
||||
"description": "Icon tool tip for recording a voice message",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_resume": {
|
||||
"translation": "Reprendre la lecture",
|
||||
"defaultMessage": "Resume playback",
|
||||
"description": "Icon tool tip for resuming audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_send": {
|
||||
"translation": "Envoyer le message",
|
||||
"defaultMessage": "Send message",
|
||||
"description": "Icon tool tip for sending a message",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1472,5 +1472,61 @@
|
||||
"description": "Marker indicating that the message was edited",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_add_image": {
|
||||
"translation": "이미지 추가",
|
||||
"defaultMessage": "Add image",
|
||||
"description": "Icon tool tip for attaching an image",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_attach_file": {
|
||||
"translation": "파일을 첨부",
|
||||
"defaultMessage": "Attach file",
|
||||
"description": "Icon tool tip for attaching a file",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_delete": {
|
||||
"translation": "녹음 삭제",
|
||||
"defaultMessage": "Delete recording",
|
||||
"description": "Icon tool tip for deleting recorded audio",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_pause": {
|
||||
"translation": "재생 일시 중지",
|
||||
"defaultMessage": "Pause playback",
|
||||
"description": "Icon tool tip for pausing audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_play": {
|
||||
"translation": "녹음 재생",
|
||||
"defaultMessage": "Play recording",
|
||||
"description": "Icon tool tip for starting audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_record_voice": {
|
||||
"translation": "음성 메시지 녹음",
|
||||
"defaultMessage": "Record voice message",
|
||||
"description": "Icon tool tip for recording a voice message",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_resume": {
|
||||
"translation": "재생 재개",
|
||||
"defaultMessage": "Resume playback",
|
||||
"description": "Icon tool tip for resuming audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_send": {
|
||||
"translation": "문자 보내",
|
||||
"defaultMessage": "Send message",
|
||||
"description": "Icon tool tip for sending a message",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1472,5 +1472,61 @@
|
||||
"description": "Marker indicating that the message was edited",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_add_image": {
|
||||
"translation": "Adauga imagine",
|
||||
"defaultMessage": "Add image",
|
||||
"description": "Icon tool tip for attaching an image",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_attach_file": {
|
||||
"translation": "Ataseaza fisier",
|
||||
"defaultMessage": "Attach file",
|
||||
"description": "Icon tool tip for attaching a file",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_delete": {
|
||||
"translation": "Ștergeți înregistrarea",
|
||||
"defaultMessage": "Delete recording",
|
||||
"description": "Icon tool tip for deleting recorded audio",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_pause": {
|
||||
"translation": "Întrerupeți redarea",
|
||||
"defaultMessage": "Pause playback",
|
||||
"description": "Icon tool tip for pausing audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_play": {
|
||||
"translation": "Redați înregistrarea",
|
||||
"defaultMessage": "Play recording",
|
||||
"description": "Icon tool tip for starting audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_record_voice": {
|
||||
"translation": "Înregistrați mesajul vocal",
|
||||
"defaultMessage": "Record voice message",
|
||||
"description": "Icon tool tip for recording a voice message",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_resume": {
|
||||
"translation": "Reluați redarea",
|
||||
"defaultMessage": "Resume playback",
|
||||
"description": "Icon tool tip for resuming audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_send": {
|
||||
"translation": "Trimite mesaj",
|
||||
"defaultMessage": "Send message",
|
||||
"description": "Icon tool tip for sending a message",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1472,5 +1472,61 @@
|
||||
"description": "Marker indicating that the message was edited",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_add_image": {
|
||||
"translation": "Добавить изображение",
|
||||
"defaultMessage": "Add image",
|
||||
"description": "Icon tool tip for attaching an image",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_attach_file": {
|
||||
"translation": "Прикрепить файл",
|
||||
"defaultMessage": "Attach file",
|
||||
"description": "Icon tool tip for attaching a file",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_delete": {
|
||||
"translation": "Удалить запись",
|
||||
"defaultMessage": "Delete recording",
|
||||
"description": "Icon tool tip for deleting recorded audio",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_pause": {
|
||||
"translation": "Пауза воспроизведения",
|
||||
"defaultMessage": "Pause playback",
|
||||
"description": "Icon tool tip for pausing audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_play": {
|
||||
"translation": "Воспроизвести запись",
|
||||
"defaultMessage": "Play recording",
|
||||
"description": "Icon tool tip for starting audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_record_voice": {
|
||||
"translation": "Записать голосовое сообщение",
|
||||
"defaultMessage": "Record voice message",
|
||||
"description": "Icon tool tip for recording a voice message",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_resume": {
|
||||
"translation": "Продолжить",
|
||||
"defaultMessage": "Resume playback",
|
||||
"description": "Icon tool tip for resuming audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_send": {
|
||||
"translation": "Отправить сообщение",
|
||||
"defaultMessage": "Send message",
|
||||
"description": "Icon tool tip for sending a message",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1472,5 +1472,61 @@
|
||||
"description": "Marker indicating that the message was edited",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_add_image": {
|
||||
"translation": "添加圖片",
|
||||
"defaultMessage": "Add image",
|
||||
"description": "Icon tool tip for attaching an image",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_attach_file": {
|
||||
"translation": "附加文件",
|
||||
"defaultMessage": "Attach file",
|
||||
"description": "Icon tool tip for attaching a file",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_delete": {
|
||||
"translation": "刪除錄音",
|
||||
"defaultMessage": "Delete recording",
|
||||
"description": "Icon tool tip for deleting recorded audio",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_pause": {
|
||||
"translation": "暫停播放",
|
||||
"defaultMessage": "Pause playback",
|
||||
"description": "Icon tool tip for pausing audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_play": {
|
||||
"translation": "播放錄音",
|
||||
"defaultMessage": "Play recording",
|
||||
"description": "Icon tool tip for starting audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_record_voice": {
|
||||
"translation": "錄製語音消息",
|
||||
"defaultMessage": "Record voice message",
|
||||
"description": "Icon tool tip for recording a voice message",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_resume": {
|
||||
"translation": "恢復播放",
|
||||
"defaultMessage": "Resume playback",
|
||||
"description": "Icon tool tip for resuming audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_send": {
|
||||
"translation": "發信息",
|
||||
"defaultMessage": "Send message",
|
||||
"description": "Icon tool tip for sending a message",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1472,5 +1472,61 @@
|
||||
"description": "Marker indicating that the message was edited",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_add_image": {
|
||||
"translation": "添加图片",
|
||||
"defaultMessage": "Add image",
|
||||
"description": "Icon tool tip for attaching an image",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_attach_file": {
|
||||
"translation": "附加文件",
|
||||
"defaultMessage": "Attach file",
|
||||
"description": "Icon tool tip for attaching a file",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_delete": {
|
||||
"translation": "删除录音",
|
||||
"defaultMessage": "Delete recording",
|
||||
"description": "Icon tool tip for deleting recorded audio",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_pause": {
|
||||
"translation": "暂停播放",
|
||||
"defaultMessage": "Pause playback",
|
||||
"description": "Icon tool tip for pausing audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_play": {
|
||||
"translation": "播放录音",
|
||||
"defaultMessage": "Play recording",
|
||||
"description": "Icon tool tip for starting audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_record_voice": {
|
||||
"translation": "录制语音信息",
|
||||
"defaultMessage": "Record voice message",
|
||||
"description": "Icon tool tip for recording a voice message",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_resume": {
|
||||
"translation": "恢复播放",
|
||||
"defaultMessage": "Resume playback",
|
||||
"description": "Icon tool tip for resuming audio playback",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
},
|
||||
"icon_title_send": {
|
||||
"translation": "发信息",
|
||||
"defaultMessage": "Send message",
|
||||
"description": "Icon tool tip for sending a message",
|
||||
"missing": false,
|
||||
"obsolete": false
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -1,6 +1,7 @@
|
||||
// Audio recorder widget.
|
||||
|
||||
import React from 'react';
|
||||
import { defineMessages, injectIntl } from 'react-intl';
|
||||
|
||||
import { secondsToTime } from '../lib/strformat';
|
||||
import { base64ToIntArray } from '../lib/blob-helpers';
|
||||
@@ -18,7 +19,15 @@ const THUMB_COLOR = '#444E';
|
||||
// Minimum number of amplitude bars to draw.
|
||||
const MIN_PREVIEW_LENGTH = 16;
|
||||
|
||||
export default class AudioPlayer extends React.PureComponent {
|
||||
const messages = defineMessages({
|
||||
icon_title_play: {
|
||||
id: 'icon_title_play',
|
||||
defaultMessage: 'Play recording',
|
||||
description: 'Icon tool tip for starting audio playback'
|
||||
}
|
||||
});
|
||||
|
||||
class AudioPlayer extends React.PureComponent {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
@@ -237,7 +246,7 @@ export default class AudioPlayer extends React.PureComponent {
|
||||
const playClass = 'material-icons' +
|
||||
(this.props.short ? '' : ' large') +
|
||||
(this.state.canPlay ? '' : ' disabled');
|
||||
const play = (<a href="#" onClick={this.handlePlay} title="Play">
|
||||
const play = (<a href="#" onClick={this.handlePlay} title={this.props.intl.formatMessage(messages.icon_title_play)}>
|
||||
<i className={playClass}>{this.state.playing ? 'pause_circle' :
|
||||
(this.state.canPlay ? 'play_circle' : 'not_interested')}</i>
|
||||
</a>);
|
||||
@@ -258,3 +267,5 @@ export default class AudioPlayer extends React.PureComponent {
|
||||
</div>);
|
||||
}
|
||||
}
|
||||
|
||||
export default injectIntl(AudioPlayer);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Audio recorder widget.
|
||||
|
||||
import React from 'react';
|
||||
import { defineMessages, injectIntl } from 'react-intl';
|
||||
|
||||
import AudioPlayer from './audio-player.jsx';
|
||||
// Workaround for https://bugs.chromium.org/p/chromium/issues/detail?id=642012
|
||||
@@ -33,7 +34,30 @@ const MAX_SAMPLES_PER_BAR = 10;
|
||||
// Recording format.
|
||||
const AUDIO_MIME_TYPE = 'audio/webm';
|
||||
|
||||
export default class AudioRecorder extends React.PureComponent {
|
||||
const messages = defineMessages({
|
||||
icon_title_delete: {
|
||||
id: 'icon_title_delete',
|
||||
defaultMessage: 'Delete recording',
|
||||
description: 'Icon tool tip for deleting recorded audio'
|
||||
},
|
||||
icon_title_pause: {
|
||||
id: 'icon_title_pause',
|
||||
defaultMessage: 'Pause playback',
|
||||
description: 'Icon tool tip for pausing audio playback'
|
||||
},
|
||||
icon_title_resume: {
|
||||
id: 'icon_title_resume',
|
||||
defaultMessage: 'Resume playback',
|
||||
description: 'Icon tool tip for resuming audio playback'
|
||||
},
|
||||
icon_title_send: {
|
||||
id: 'icon_title_send',
|
||||
defaultMessage: 'Send message',
|
||||
description: 'Icon tool tip for sending a message'
|
||||
},
|
||||
});
|
||||
|
||||
class AudioRecorder extends React.PureComponent {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
@@ -315,10 +339,11 @@ export default class AudioRecorder extends React.PureComponent {
|
||||
}
|
||||
|
||||
render() {
|
||||
const {formatMessage} = this.props.intl;
|
||||
const resumeClass = 'material-icons ' + (this.state.enabled ? 'red' : 'gray');
|
||||
return (
|
||||
<div className="audio">
|
||||
<a href="#" onClick={this.handleDelete} title="Delete">
|
||||
<a href="#" onClick={this.handleDelete} title={formatMessage(messages.icon_title_delete)}>
|
||||
<i className="material-icons gray">delete_outline</i>
|
||||
</a>
|
||||
{this.state.recording ?
|
||||
@@ -332,17 +357,19 @@ export default class AudioRecorder extends React.PureComponent {
|
||||
}
|
||||
<div className="duration">{this.state.duration}</div>
|
||||
{this.state.recording ?
|
||||
<a href="#" onClick={this.handlePause} title="Pause">
|
||||
<a href="#" onClick={this.handlePause} title={formatMessage(messages.icon_title_pause)}>
|
||||
<i className="material-icons">pause_circle_outline</i>
|
||||
</a> :
|
||||
<a href="#" onClick={this.handleResume} title="Resume">
|
||||
<a href="#" onClick={this.handleResume} title={formatMessage(messages.icon_title_resume)}>
|
||||
<i className={resumeClass}>radio_button_checked</i>
|
||||
</a>
|
||||
}
|
||||
<a href="#" onClick={this.handleDone} title="Send">
|
||||
<a href="#" onClick={this.handleDone} title={formatMessage(messages.icon_title_send)}>
|
||||
<i className="material-icons">send</i>
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default injectIntl(AudioRecorder);
|
||||
|
||||
@@ -37,6 +37,26 @@ const messages = defineMessages({
|
||||
defaultMessage: 'Cannot initiate file upload.',
|
||||
description: 'Generic error messagewhen attachment fails'
|
||||
},
|
||||
icon_title_record_voice: {
|
||||
id: 'icon_title_record_voice',
|
||||
defaultMessage: 'Record voice message',
|
||||
description: 'Icon tool tip for recording a voice message'
|
||||
},
|
||||
icon_title_attach_file: {
|
||||
id: 'icon_title_attach_file',
|
||||
defaultMessage: 'Attach file',
|
||||
description: 'Icon tool tip for attaching a file'
|
||||
},
|
||||
icon_title_add_image: {
|
||||
id: 'icon_title_add_image',
|
||||
defaultMessage: 'Add image',
|
||||
description: 'Icon tool tip for attaching an image'
|
||||
},
|
||||
icon_title_send: {
|
||||
id: 'icon_title_send',
|
||||
defaultMessage: 'Send message',
|
||||
description: 'Icon tool tip for sending a message'
|
||||
},
|
||||
});
|
||||
|
||||
class SendMessage extends React.PureComponent {
|
||||
@@ -221,10 +241,10 @@ class SendMessage extends React.PureComponent {
|
||||
<>
|
||||
{this.props.onAttachFile && !this.state.audioRec ?
|
||||
<>
|
||||
<a href="#" onClick={e => {e.preventDefault(); this.attachImage.click();}} title="Add image">
|
||||
<a href="#" onClick={e => {e.preventDefault(); this.attachImage.click();}} title={formatMessage(messages.icon_title_add_image)}>
|
||||
<i className="material-icons secondary">photo</i>
|
||||
</a>
|
||||
<a href="#" onClick={e => {e.preventDefault(); this.attachFile.click();}} title="Attach file">
|
||||
<a href="#" onClick={e => {e.preventDefault(); this.attachFile.click();}} title={formatMessage(messages.icon_title_attach_file)}>
|
||||
<i className="material-icons secondary">attach_file</i>
|
||||
</a>
|
||||
</>
|
||||
@@ -245,11 +265,11 @@ class SendMessage extends React.PureComponent {
|
||||
ref={(ref) => {this.messageEditArea = ref;}}
|
||||
autoFocus />)}
|
||||
{this.state.message || !audioEnabled ?
|
||||
<a href="#" onClick={this.handleSend} title="Send">
|
||||
<a href="#" onClick={this.handleSend} title={formatMessage(messages.icon_title_send)}>
|
||||
<i className="material-icons">{sendIcon}</i>
|
||||
</a> :
|
||||
!this.state.audioRec ?
|
||||
<a href="#" onClick={e => {e.preventDefault(); this.setState({audioRec: true})}} title="Voice">
|
||||
<a href="#" onClick={e => {e.preventDefault(); this.setState({audioRec: true})}} title={formatMessage(messages.icon_title_record_voice)}>
|
||||
<i className="material-icons">mic</i>
|
||||
</a> :
|
||||
null
|
||||
|
||||
Reference in New Issue
Block a user