Fix pip exception on Android (#232)
This commit is contained in:
parent
1caae18148
commit
8f8bb1ae28
1 changed files with 5 additions and 1 deletions
|
|
@ -232,7 +232,11 @@ abstract class VideoStoreBase with Store {
|
|||
@action
|
||||
void dispose() {
|
||||
// Disable auto PiP when leaving so that we don't enter PiP on other screens.
|
||||
if (Platform.isAndroid) pip.setAutoPipMode(autoEnter: false);
|
||||
if (Platform.isAndroid) {
|
||||
SimplePip.isAutoPipAvailable.then((isAutoPipAvailable) {
|
||||
if (isAutoPipAvailable) pip.setAutoPipMode(autoEnter: false);
|
||||
});
|
||||
}
|
||||
|
||||
// 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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue