Fix video overlay buttons firing when not visible
This commit is contained in:
parent
3275fd9123
commit
2728080400
2 changed files with 19 additions and 13 deletions
|
|
@ -23,13 +23,15 @@ abstract class _VideoStoreBase with Store {
|
|||
var paused = false;
|
||||
|
||||
void handlePausePlay() {
|
||||
if (paused) {
|
||||
controller.runJavascript('document.getElementsByTagName("video")[0].play();');
|
||||
} else {
|
||||
controller.runJavascript('document.getElementsByTagName("video")[0].pause();');
|
||||
}
|
||||
if (menuVisible) {
|
||||
if (paused) {
|
||||
controller.runJavascript('document.getElementsByTagName("video")[0].play();');
|
||||
} else {
|
||||
controller.runJavascript('document.getElementsByTagName("video")[0].pause();');
|
||||
}
|
||||
|
||||
paused = !paused;
|
||||
paused = !paused;
|
||||
}
|
||||
}
|
||||
|
||||
void handleVideoTap() async {
|
||||
|
|
|
|||
|
|
@ -54,7 +54,9 @@ class Video extends StatelessWidget {
|
|||
Icons.arrow_back,
|
||||
color: Colors.white,
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
onPressed: () {
|
||||
if (videoStore.menuVisible) Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
const Spacer(),
|
||||
IconButton(
|
||||
|
|
@ -63,12 +65,14 @@ class Video extends StatelessWidget {
|
|||
color: Colors.white,
|
||||
),
|
||||
onPressed: () {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return Settings(settingsStore: settingsStore);
|
||||
},
|
||||
);
|
||||
if (videoStore.menuVisible) {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return Settings(settingsStore: settingsStore);
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue