youtube_player_iframe Share Button Not Responding on Android

46 Views Asked by At

I'm developing a Flutter app and using youtube_player_iframe to embed YouTube videos.

Everything functions as expected on iOS; however, I encounter an issue on Android where I'm unable to use the built-in share button within the video player to share videos. Specifically, the share button, represented by three dots, doesn't respond when tapped. It's worth noting that the Facebook and Twitter share buttons work without any issues.

void _initController() {
    _controller = YoutubePlayerController.fromVideoId(
      videoId: YoutubePlayerController.convertUrlToId(widget.url)!,
      autoPlay: false,
      params: const YoutubePlayerParams(
        showFullscreenButton: true,
        showControls: true,
        enableCaption: false,
        enableJavaScript: true,
        showVideoAnnotations: false,
      ),
    );
  }
 Widget build(BuildContext context) {
    return YoutubePlayerScaffold(
        defaultOrientations: const [DeviceOrientation.portraitUp],
        backgroundColor: Colors.black,
        autoFullScreen: false,
        controller: _controller,
        builder: (context, player) {
          return widget.playerWrapper?.call(player) ?? player;
        },
    );
  }

Flutter 3.16.9 youtube_player_iframe: ^4.0.4 Tested on Android 9, 10 and 12

I've checked the WebView settings and made sure JavaScript is enabled. I also ensured that the latest versions of Google Chrome and Android System WebView are installed on the device. None of these solutions helped.

I want users to be able to share videos on Android just as they can on iOS.

0

There are 0 best solutions below