abdelaziz-mahdy / flutter_meedu_videoplayer

Cross-Platform Video Player for flutter
https://abdelaziz-mahdy.github.io/flutter_meedu_videoplayer/
MIT License
132 stars 69 forks source link

Web - Tap Gesture not working when video is covering below the controls #126

Open ponnamkarthik opened 1 year ago

ponnamkarthik commented 1 year ago

Here is the demo link where we can test it

https://648d83a494a86669f2b9382f--magenta-salamander-282bb4.netlify.app/#/

when i visit VOD page and wait till the video loaded and once the controllers are hidden i cannot bring them back by clicking on the video and also unable to click any controls its not responding

abdelaziz-mahdy commented 1 year ago

Please provide sample code since the controls work on the package demo, so most probably it's a problem in your code.

Providing the code helps debugging it, and knowing what is causing the problem

ponnamkarthik commented 1 year ago
class VodPlayer extends StatefulWidget {
  const VodPlayer({Key? key}) : super(key: key);

  @override
  State<VodPlayer> createState() => _VodPlayerState();
}

class _VodPlayerState extends State<VodPlayer> {

  final _meeduPlayerController = MeeduPlayerController(
    controlsStyle: ControlsStyle.primary,
    controlsEnabled: true,
    enabledControls: EnabledControls(),

    enabledOverlays: const EnabledOverlays(),
      enabledButtons: const EnabledButtons(
      ),
  );

  @override
  void initState() {
    super.initState();
    Wakelock.enable();
    WidgetsBinding.instance!.addPostFrameCallback((_) {
      _init();
    });

  }

  @override
  void dispose() {
    Wakelock.disable();
    _meeduPlayerController.dispose();// release the video player
    super.dispose();
  }

  _init() {
    _meeduPlayerController.setDataSource(
      DataSource(
        type: DataSourceType.network,
        source: "https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8",
      ),
      autoplay: true,
    );
  }

  @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Scaffold(
        appBar: AppBar(
          title: Text("VOD Player",style: TextStyle(color: Colors.black,fontWeight: FontWeight.w700,fontSize: 14),),
        ),
        body: SingleChildScrollView(
          child: Column(
            children: [
              AspectRatio(
                aspectRatio: 16 / 9,
                child: MeeduVideoPlayer(
                  controller: _meeduPlayerController,
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

here is the code for the player i used

there are some cases where only play and pause works remaining all buttons are not clickable even if we click on any of those button it just play/pause

abdelaziz-mahdy commented 1 year ago

Does the mobile app work correctly?

ponnamkarthik commented 1 year ago

Works perfectly on mobile issue is on web

abdelaziz-mahdy commented 1 year ago

Works perfectly on mobile issue is on web

Well that's weird, can it be a problem with flutter itself? I don't see a problem with your code