fluttercommunity / fluttercommunity/chewie

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

Open
#853 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Dart
Stars
2.1k
Forks
1.1k
Avg merge
6d 8h
Merged PRs (30d)
6

Description

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

### Screenshot
![image](https://github.com/user-attachments/assets/ec8a492a-e32c-46fa-849a-c8dc99061b83)

### Code Sample

Code sample

```dart
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 createState() => _VideoPlayerState();
}

class _VideoPlayerState extends State {
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 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!

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Use the provided ChewieExample with allowMuting: false and run it on Flutter web to reproduce the visible control. Trace how ChewieController.allowMuting is handled by the web controls; done means the muting control is hidden and muting/unmuting is disabled when the option is false.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.