Handling Headphones/AirPods control through WKWebView

When using WKWebView, the play/pause functions in javascript are not triggered when trying to toggle play/pause events using headphones/AirPods (double tap).

How do we control these events using headphones/AirPods in the WKWebView?
I'm having difficulty understanding your question.

Are you saying that when headphones or AirPods are connected, trying to toggle play/pause from that does not end up affecting video or audio playing in your app, which embeds a WKWebView?

Is the media element playing with sound?
Handling Headphones/AirPods control through WKWebView
 
 
Q