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

时间:2018-10-05 12:30:32

标签: youtube dart flutter containers

我遵循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
    );
  }

enter image description here

1 个答案:

答案 0 :(得分:1)

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