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

[initialMediaPlaybackPolicy: AutoMediaPlaybackPolicy.alwaysAllow] throws error 'Unsupported operation: add' #13

Open
r-durao-pvotal opened this issue Jun 12, 2023 · 0 comments

Comments

@r-durao-pvotal
Copy link

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

class IFrameSample extends StatefulWidget {
  const IFrameSample({
    required this.width,
    required this.height,
    super.key,
  });

  final double width;
  final double height;

  @override
  State<IFrameSample> createState() => _IFrameSampleState();
}

class _IFrameSampleState extends State<IFrameSample> {
  late WebViewXController webviewController;

  @override
  Widget build(BuildContext context) {
    return WebViewX(
      width: widget.width,
      height: widget.height,
      initialContent: '<h2> Loading </h2>',
      initialSourceType: SourceType.html,
      onWebViewCreated: (controller) => webviewController = controller
        ..loadContent(
          'https://google.com',
        ),
      initialMediaPlaybackPolicy: AutoMediaPlaybackPolicy.alwaysAllow,
    );
  }
}

This throws an error

│ ⛔ === UI ERROR ===
│ ⛔ Unsupported operation: add
│ ⛔ dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 288:49
throw_
│ ⛔ dart-sdk/lib/_internal/js_dev_runtime/private/js_array.dart 76:7
checkGrowable]
│ ⛔ dart-sdk/lib/_internal/js_dev_runtime/private/js_array.dart 82:5
add]
│ ⛔ webviewx_plus-0.3.3/lib/src/view/impl/web.dart 369:12
[_createIFrame]
│ ⛔ /webviewx_plus-0.3.3/lib/src/view/impl/web.dart 159:14
initState

am I missing a step?

@r-durao-pvotal r-durao-pvotal changed the title initialMediaPlaybackPolicy: AutoMediaPlaybackPolicy.alwaysAllow throws error 'Unsupported operation: add' [initialMediaPlaybackPolicy: AutoMediaPlaybackPolicy.alwaysAllow] throws error 'Unsupported operation: add' Jun 12, 2023
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