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?
Asked
Active
Viewed 124 times
0
-
Get thumbnail https://stackoverflow.com/a/2068371/13701546 and format tile as you like. you can get other YT api here https://developers.google.com/youtube/v3/docs/thumbnails#resource if you need more data – Simon Sot Jan 28 '22 at 06:52
-
@SimonSot i want that i am using share_plus package to share my video url to any app i share so when i share then this look like to show if my app is not download then if user click this video then it will go to playstore to download my app. this video is not coming from youtube but it came from restful api – Adnan haider Jan 28 '22 at 06:57
-
it's called deeplinks, you should check docs here [link](https://docs.flutter.dev/development/ui/navigation/deep-linking) – Ruchit Jan 28 '22 at 07:03
-
@Ruchit i try or check – Adnan haider Jan 28 '22 at 07:06
1 Answers
1
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: '...');
}
-
Can you explain little bit what happens i am new in flutter so i dont understand easily – Adnan haider Jan 28 '22 at 07:34
-
what is page.link why parse youtube link kingly explain @BloodLoss – Adnan haider Jan 28 '22 at 10:52
-
link only show title with image and details for youtube i add my video link which are on my server but the issue is it did not show as it did on youtube links – Adnan haider Jan 29 '22 at 10:31