wendux / DSBridge-IOS

:earth_asia: A modern cross-platform JavaScript bridge, through which you can invoke each other's functions synchronously or asynchronously between JavaScript and native.
1.96k stars 308 forks source link

Prompt will interrupt video playback in iOS12 #76

Open springuper opened 5 years ago

springuper commented 5 years ago

DSBridge uses window.prompt as the communication channel from JS to iOS, but there is one issue in iOS12: the video playback will be paused whenever we make a call from JS to iOS.

image

I found that it's caused by some new behavior of prompt in iOS12. Once it's called, the video element emits a pause event.

Should we find some configuration option to workaround it, or we need to find another communication channel other than prompt?

springuper commented 5 years ago

I'm going to use Message Handler in WKWebview to workaround, but it doesn't support synchronous call, many changes many need to finish. I may create a PR later.