OPUS сборка

This commit is contained in:
RoyceDa
2026-04-10 17:54:48 +02:00
parent b596d36543
commit ba12db3c72
2 changed files with 50 additions and 13 deletions

View File

@@ -114,8 +114,6 @@ export function MessageVoice(props: AttachmentProps) {
totalDuration,
currentMessageId,
} = usePlayerContext();
// Важно: состояние "активности" теперь берется из глобального плеера
const messageId = String((props.parent as any)?.id ?? (props.attachment as any)?.messageId ?? props.attachment.id);
const isCurrentTrack = currentMessageId === messageId;
@@ -123,7 +121,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" });
const createAudioBlob = () => new Blob([Buffer.from(props.attachment.blob, "binary")], { type: "audio/webm;codecs=opus" });
const ensureStarted = (seekToSec?: number) => {
const blob = createAudioBlob();
@@ -204,7 +202,7 @@ export function MessageVoice(props: AttachmentProps) {
{downloadStatus !== DownloadStatus.DOWNLOADED && <IconArrowDown color="white" size={22} />}
{downloadStatus === DownloadStatus.DOWNLOADED &&
{downloadStatus === DownloadStatus.DOWNLOADED && !isUploading &&
(isCurrentTrack && playing ? (
<IconPlayerPauseFilled color="white" size={22} />
) : (