Video/audio pauses automatically in WKWebView after app returns from background

We are embedding TikTok Live streams inside our iOS app using WKWebView. The Live stream loads and plays normally at first. However, when the app goes to the background (for example, user presses the Home button or switches apps) and then returns to the foreground, the TikTok Live video and audio become paused and do not resume automatically.

Expected behavior

When the app returns from the background to the foreground, the video/audio should resume playback automatically

Actual behavior

Video/audio pauses after app resumes from background

Any guidance would be greatly appreciated.

Thank you.

We had the same issue. We solved it by using visibilitychange, which allowed us to confirm the video and audio state and control media playback.

Have a great rest of your day.

Thank you.

Video/audio pauses automatically in WKWebView after app returns from background
 
 
Q