С binary на hex
This commit is contained in:
@@ -105,6 +105,7 @@ export function MessageVoice(props: AttachmentProps) {
|
||||
const waveformWidth = WAVE_BARS * BAR_WIDTH + (WAVE_BARS - 1) * BAR_GAP;
|
||||
const waveformRef = useRef<HTMLDivElement | null>(null);
|
||||
|
||||
|
||||
const {
|
||||
playAudio,
|
||||
pause,
|
||||
@@ -121,7 +122,7 @@ export function MessageVoice(props: AttachmentProps) {
|
||||
const safeCurrent = isCurrentTrack ? currentDuration : 0;
|
||||
const playbackProgress = Math.max(0, Math.min(1, safeCurrent / fullDuration));
|
||||
|
||||
const createAudioBlob = () => new Blob([Buffer.from(props.attachment.blob, "binary")], { type: "audio/webm;codecs=opus" });
|
||||
const createAudioBlob = () => new Blob([Buffer.from(props.attachment.blob, "hex")], { type: "audio/webm;codecs=opus" });
|
||||
|
||||
const ensureStarted = (seekToSec?: number) => {
|
||||
const blob = createAudioBlob();
|
||||
@@ -186,13 +187,11 @@ export function MessageVoice(props: AttachmentProps) {
|
||||
>
|
||||
{!error && (
|
||||
<>
|
||||
{downloadStatus === DownloadStatus.DOWNLOADING &&
|
||||
downloadPercentage > 0 &&
|
||||
downloadPercentage < 100 && (
|
||||
<div style={{ position: "absolute", top: 0, left: 0 }}>
|
||||
<AnimatedRoundedProgress size={40} value={downloadPercentage} />
|
||||
</div>
|
||||
)}
|
||||
{downloadStatus === DownloadStatus.DOWNLOADING && (
|
||||
<div style={{ position: "absolute", top: 0, left: 0 }}>
|
||||
<AnimatedRoundedProgress size={40} value={Math.max(1, downloadPercentage)} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{isUploading && (
|
||||
<div style={{ position: "absolute", top: 0, left: 0 }}>
|
||||
|
||||
Reference in New Issue
Block a user