最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Safari - Audio Management for inactive tabs - Stack Overflow

programmeradmin0浏览0评论

Problem

In our enterprise React application, we're experiencing audio playback issues in Safari with the following scenario:

  1. The app contains an iframe that plays MP3 narrations using Howler.js
  2. When the tab becomes inactive due to no user activity, Safari kills the resources and stops the audio
  3. Upon returning to the tab and interacting, all functionality resumes except for audio playback
  4. Currently, the only workaround is closing the tab and opening a new one

Question

Is there a way to restore audio playback functionality when the tab becomes active again, without requiring a tab refresh?

Technical Details

  1. Framework: React Audio
  2. Library: Howler.js
  3. Browser: Safari Content
  4. MP3 files played within an iframe

Expected Behavior

Audio playback should resume normally when returning to the tab and interacting with it.

Current Behavior

Audio remains non-functional after tab becomes active again, requiring a complete tab refresh to restore functionality.

发布评论

评论列表(0)

  1. 暂无评论