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

YouTube embedded player in webview #28

Open
velsa opened this issue Dec 19, 2018 · 6 comments
Open

YouTube embedded player in webview #28

velsa opened this issue Dec 19, 2018 · 6 comments

Comments

@velsa
Copy link

velsa commented Dec 19, 2018

I've set the option 'mediaPlaybackRequiresUserGesture': false, but youtube player still doesn't autostart. I'm emeding YouTube player in webview by opening a url https://www.youtube.com/embed/Mz3kHQxBjGg?autoplay=1

Any ideas on how to make it autoplay in the webview?

@SteadyAction
Copy link

Same issue!

@SteadyAction
Copy link

@pichillilorenzo

@maltub9
Copy link

maltub9 commented Dec 13, 2019

I encounter an issue when I click on full screen button inside the youtube video. the app crush after that. what is the solution for this?

@pichillilorenzo
Copy link
Owner

@maltub9 please post the error log you get, otherwise I can't fix it. Also, if possible, post the code you are using to show the youtube video in order to debug it. Thanks

@mind-easy
Copy link

I still have the same issue. Is there a solution for this?

@water-user
Copy link

water-user commented May 17, 2022

Same here, version ^5.4.3+7, Here's the code:

  InAppWebViewGroupOptions options = InAppWebViewGroupOptions(
      crossPlatform: InAppWebViewOptions(
        useShouldOverrideUrlLoading: true,
        mediaPlaybackRequiresUserGesture: false,
      ),
      android: AndroidInAppWebViewOptions(
        useHybridComposition: true,
      ),
      ios: IOSInAppWebViewOptions(
        allowsInlineMediaPlayback: true,
      ));
  @override
  Widget build(BuildContext context) {
    return InAppWebView(
      key: webViewKey,
      initialUrlRequest: URLRequest(
        url: Uri.parse('https://www.youtube.com/embed/q_dsgjGRBsw?autoplay=1'),
      ),
      initialOptions: options,
      onWebViewCreated: (controller) {
        webViewController = controller;
      },
    );
  }

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

6 participants