fix(music): autoplay rejections are only logged and never retried

Đang mở
#499 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
audio-video-rtc

Hướng nghiên cứu

Start with the rejection handlers at modules/music/src/music.library.ts:70-73 and modules/sound/src/sound.library.ts:62-64, then trace how music starts in main and how input events are registered. Check existing tests around playback and input handling, or add coverage for AbortError and NotAllowedError. Done means aborted switches are not logged as errors and blocked music retries after the first pointerdown or keydown.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug modules:music modules:sound
Which package is this bug report for?

music

Issue description

A NotAllowedError (autoplay blocked before a user gesture) is only logged as Got error: …, and _current points to a track that is not playing, so menu music started in main stays silent for the whole session. An expected AbortError (switching tracks quickly) is logged as an error too.

Where:

Evidence:

this._current.play().catch((error: unknown) => {
  console.error(`Got error: ${error}`);
});

Suggested fix: Ignore AbortError. On NotAllowedError, keep the pending track and retry on the first pointerdown / keydown.

Found during a code audit of main at be72076.

Code sample

No response

Versions
  • Engine main at be72076
  • pnpm 12.0.0, Node.js 26, Bun 1.3.14
Issue priority

Medium (should be fixed soon)

I have tested this issue on a development release

be72076

Ngôn ngữ chính
TypeScript
Star
7
Fork
2
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
17

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NanoForge-dev/Engine

Tất cả issue của NanoForge-dev/Engine

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.