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

feat: enable or disable debug webview #948

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/youtube_player_flutter/lib/src/player/youtube_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// found in the LICENSE file.

import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';

import '../enums/thumbnail_quality.dart';
import '../utils/errors.dart';
Expand Down Expand Up @@ -130,6 +131,13 @@ class YoutubePlayer extends StatefulWidget {
/// {@endtemplate}
final bool showVideoProgressIndicator;

/// {@template youtube_player_flutter.enableDebugWebView}
/// Enable or disable debugging info web view.
///
/// Default is true.
/// {@endtemplate}
final bool enableDebugWebView;

/// Creates [YoutubePlayer] widget.
const YoutubePlayer({
this.key,
Expand All @@ -148,6 +156,7 @@ class YoutubePlayer extends StatefulWidget {
this.actionsPadding = const EdgeInsets.all(8.0),
this.thumbnail,
this.showVideoProgressIndicator = false,
this.enableDebugWebView = true,
}) : progressColors = progressColors ?? const ProgressBarColors(),
progressIndicatorColor = progressIndicatorColor ?? Colors.red;

Expand Down Expand Up @@ -199,6 +208,8 @@ class _YoutubePlayerState extends State<YoutubePlayer> {
@override
void initState() {
super.initState();
PlatformInAppWebViewController.debugLoggingSettings.enabled =
widget.enableDebugWebView;
controller = widget.controller..addListener(listener);
_aspectRatio = widget.aspectRatio;
}
Expand Down