我遵循Flutter flutter_youtube 1.1.1的示例,但是它只能单击按钮并以youtube视频开始页面。我可以将YouTube视频放入容器或盒子中吗?

 void playYoutubeVideoEdit() {
    var youtube = new FlutterYoutube();

    youtube.onVideoEnded.listen((onData) {
      //perform your action when video playing is done
    });

    FlutterYoutube.playYoutubeVideoByUrl(
      apiKey: "fdsfsgfdsgf-Fp_KPafdsfdgfdgfdssdfsWVHCoiWCVwh8",
      videoUrl: "https://www.youtube.com/watch?v=D5jK8W4wlu8",
      autoPlay: true,
      fullScreen: false
    );
  }

youtube - 在容器或盒子内拍打YouTube视频-LMLPHP

最佳答案

你也写了正确的答案;)
example here
如果要查看缩略图,则必须使用youtube data api

10-01 23:48