Fix PiP not dismissing on iOS (#168)

Reload webview when dispoing video
This commit is contained in:
Tommy Chow 2022-07-31 20:51:27 -04:00 • committed by GitHub
parent 9b4b34f647
commit 43d55c785b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -285,7 +285,10 @@ abstract class VideoStoreBase with Store {
@action
void dispose() {
controller?.runJavascript('document.getElementsByTagName("video")[0].pause();');
// Not ideal, but seems like the only way of disposing of the video properly.
// Will both prevent the video from continuing to play when dismissed and closes PiP on iOS.
controller?.reload();
_disposeOverlayReaction();
floating.dispose();
sleepTimer?.cancel();