Adnan haider
Adnan haider

Reputation: 563

Share video to other app which show thumnail in flutter

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?

enter image description here

Upvotes: 0

Views: 422

Answers (1)

BIS Tech
BIS Tech

Reputation: 19514

You can use firebase-dynamic-links for this.

screenshot

  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

Related Questions