Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Web] allowMuting: false doesn't hide muting control #853

Open
arturoszulc opened this issue Sep 16, 2024 · 0 comments
Open

[Web] allowMuting: false doesn't hide muting control #853

arturoszulc opened this issue Sep 16, 2024 · 0 comments

Comments

@arturoszulc
Copy link

Problem

Setting allowMuting: false should hide muting control and disable muting/unmuting. But it doesn't on web.

Screenshot

image

Code Sample

Code sample
import 'package:chewie/chewie.dart';
import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';

void main() {
  runApp(const MainApp());
}

class MainApp extends StatelessWidget {
  const MainApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Scaffold(
        body: Center(
          child: ChewieExample(),
        ),
      ),
    );
  }
}

class ChewieExample extends StatefulWidget {
  const ChewieExample({super.key});

  @override
  State<StatefulWidget> createState() => _VideoPlayerState();
}

class _VideoPlayerState extends State<ChewieExample> {
  late VideoPlayerController _controller;
  late ChewieController _chewieController;
  late Uri uri;
  @override
  void initState() {
    super.initState();
    _controller = VideoPlayerController.networkUrl(Uri.parse(
        'https://flutter.github.io/assets-for-api-docs/assets/videos/butterfly.mp4'));
    _chewieController = ChewieController(
      allowPlaybackSpeedChanging: false,
      allowMuting: false,
      hideControlsTimer: const Duration(seconds: 1),
      videoPlayerController: _controller,
      showOptions: false,
    );
  }

  Future<bool> initController() async {
    await _controller.initialize();
    return true;
  }

  @override
  void dispose() {
    _controller.dispose();
    _chewieController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return FutureBuilder(
      future: initController(),
      builder: (context, snapshot) => Center(
        child: !snapshot.hasData
            ? const CircularProgressIndicator()
            : _controller.value.isInitialized
                ? AspectRatio(
                    aspectRatio: _controller.value.aspectRatio,
                    child: Chewie(controller: _chewieController),
                  )
                : Container(),
      ),
    );
  }
}

Flutter doctor

Flutter doctor

[√] Flutter (Channel stable, 3.24.2, on Microsoft Windows [Version 10.0.22631.4169], locale pl-PL)
    • Flutter version 3.24.2 on channel stable at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4cf269e36d (13 days ago), 2024-09-03 14:30:00 -0700
    • Engine revision a6bd3f1de1
    • Dart version 3.5.2
    • DevTools version 2.37.2

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at C:\Users\artur\AppData\Local\Android\Sdk
    • Platform android-33, build-tools 33.0.2
    • ANDROID_HOME = C:\Users\artur\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.1.3)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.1.32328.378
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2022.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)

[√] VS Code, 64-bit edition (version 1.93.0)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.96.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22631.4169]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 128.0.6613.138
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 128.0.2739.79

[√] Network resources
    • All expected network resources are available.

• No issues found!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant