Better fix for 2728080

This commit is contained in:
tommyxchow 2021-11-13 03:44:32 -05:00
parent 2728080400
commit b78625eba6
2 changed files with 62 additions and 65 deletions

View file

@ -23,15 +23,13 @@ abstract class _VideoStoreBase with Store {
var paused = false;
void handlePausePlay() {
if (menuVisible) {
if (paused) {
controller.runJavascript('document.getElementsByTagName("video")[0].play();');
} else {
controller.runJavascript('document.getElementsByTagName("video")[0].pause();');
}
paused = !paused;
if (paused) {
controller.runJavascript('document.getElementsByTagName("video")[0].play();');
} else {
controller.runJavascript('document.getElementsByTagName("video")[0].pause();');
}
paused = !paused;
}
void handleVideoTap() async {

View file

@ -42,73 +42,72 @@ class Video extends StatelessWidget {
return AnimatedOpacity(
opacity: videoStore.menuVisible ? 1.0 : 0.0,
duration: const Duration(milliseconds: 100),
child: ColoredBox(
color: Colors.black.withOpacity(0.5),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
IconButton(
icon: const Icon(
Icons.arrow_back,
color: Colors.white,
child: Visibility(
visible: videoStore.menuVisible,
child: ColoredBox(
color: Colors.black.withOpacity(0.5),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
IconButton(
icon: const Icon(
Icons.arrow_back,
color: Colors.white,
),
onPressed: () => Navigator.of(context).pop(),
),
onPressed: () {
if (videoStore.menuVisible) Navigator.of(context).pop();
},
),
const Spacer(),
IconButton(
icon: const Icon(
Icons.settings,
color: Colors.white,
),
onPressed: () {
if (videoStore.menuVisible) {
const Spacer(),
IconButton(
icon: const Icon(
Icons.settings,
color: Colors.white,
),
onPressed: () {
showModalBottomSheet(
context: context,
builder: (context) {
return Settings(settingsStore: settingsStore);
},
);
}
},
),
],
),
IconButton(
icon: videoStore.paused
? const Icon(
Icons.play_arrow,
color: Colors.white,
)
: const Icon(
Icons.pause,
},
),
],
),
IconButton(
icon: videoStore.paused
? const Icon(
Icons.play_arrow,
color: Colors.white,
)
: const Icon(
Icons.pause,
color: Colors.white,
),
onPressed: videoStore.handlePausePlay,
),
Row(
children: [
IconButton(
icon: const Icon(
Icons.refresh,
color: Colors.white,
),
onPressed: videoStore.handlePausePlay,
),
Row(
children: [
IconButton(
icon: const Icon(
Icons.refresh,
color: Colors.white,
onPressed: () {},
),
onPressed: () {},
),
const Spacer(),
IconButton(
icon: const Icon(
Icons.fullscreen,
color: Colors.white,
),
onPressed: videoStore.requestFullscreen,
)
],
)
],
const Spacer(),
IconButton(
icon: const Icon(
Icons.fullscreen,
color: Colors.white,
),
onPressed: videoStore.requestFullscreen,
)
],
)
],
),
),
),
);