Reputation: 563
when I share a youtube video via the youtube app from mobile to Whatsapp then it shows a thumbnail with the link is it possible to do it in a flutter as like that, in this video share range rover video on Whatsapp when I go to Whatsapp it looks like that, I want this in my flutter app any idea?
Upvotes: 0
Views: 422
Reputation: 19514
You can use firebase-dynamic-links for this.
void testingVideoLink() async {
String uriPrefix = 'https://....page.link';
final DynamicLinkParameters parameters = DynamicLinkParameters(
uriPrefix: uriPrefix,
link: Uri.parse('https://www.youtube.com/watch?v=_SB7h2kB6Eg'),
);
final ShortDynamicLink shortDynamicLink = await FirebaseDynamicLinks.instance.buildShortLink(parameters);
Uri uri = shortDynamicLink.shortUrl;
Share.share(uri.toString(), subject: '...');
}
Upvotes: 1