Flutter:在 iOS 版本的 YouTube 应用中打开视频
Flutter : open video in YouTube App in iOS version
我有一个包含 YouTube 视频的应用程序,我想在 YouTube 应用程序中打开它们,对于 android 我使用了 android_intent 包,IOS 是否有相同的包?还是另一种方式?
android_intemt代码:
child: InkWell(
onTap: () async {
await intent.launch();
},
child: YoutubePlayer(
controller: _controller,
showVideoProgressIndicator: true,
progressIndicatorColor: Colors.blueAccent,
),)
您可以使用 url_launcher
to open the YouTube link (works on iOS as well as Android). If it doesn't open in the YouTube app, try launching a URL starting with youtube://
. See 答案了解更多详情。
我有一个包含 YouTube 视频的应用程序,我想在 YouTube 应用程序中打开它们,对于 android 我使用了 android_intent 包,IOS 是否有相同的包?还是另一种方式? android_intemt代码:
child: InkWell(
onTap: () async {
await intent.launch();
},
child: YoutubePlayer(
controller: _controller,
showVideoProgressIndicator: true,
progressIndicatorColor: Colors.blueAccent,
),)
您可以使用 url_launcher
to open the YouTube link (works on iOS as well as Android). If it doesn't open in the YouTube app, try launching a URL starting with youtube://
. See