video_info_plush 1.0.0

SDKflutter
Platformandroidioswindowslinuxmacosweb

A Dart plugin that provides functionality to extract video IDs from YouTube URLs and retrieve thumbnail images.

VideoInfoPlus

Overview

VideoInfoPlus is a Dart plugin that provides functionality to extract video IDs from YouTube URLs and retrieve thumbnail images for those videos. This plugin is useful for developers who want to integrate YouTube video information into their applications.

Features

  • Extract Video ID: Easily extract the video ID from a given YouTube URL.
  • Get Thumbnail URL: Retrieve a placeholder thumbnail URL for a specified YouTube video ID.

Installation

To use VideoInfoPlus in your Dart or Flutter project, add the following dependency to your pubspec.yaml file:

dependencies:
  video_info_plush: ^1.0.0

Then, run flutter pub get or dart pub get to install the package.

Usage

Importing the Package

First, import the package in your Dart file:

import 'package:video_info_plush/video_info_plush.dart';

Extracting Video ID

To extract the video ID from a YouTube URL, use the getVideoIdFromUrl method:

final videoInfoPlush = VideoInfoPlush();
String videoId = videoInfoPlush.getVideoIdFromUrl(url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ');
print('Video ID: $videoId');

Getting Thumbnail URL

To get the thumbnail URL for a YouTube video, use the getThumbnailUrl method:

String thumbnailUrl = videoInfoPlush.getThumbnailUrl(url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ');
print('Thumbnail URL: $thumbnailUrl');

Example

Here's a complete example of how to use the VideoInfoPlus plugin:

import 'package:video_info_plush/video_info_plush.dart';

void main() {
  final videoInfoPlush = VideoInfoPlush();
  
  String url = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ';
  
  String videoId = videoInfoPlush.getVideoIdFromUrl(url: url);
  print('Video ID: $videoId');
  
  String thumbnailUrl = videoInfoPlush.getThumbnailUrl(url: url);
  print('Thumbnail URL: $thumbnailUrl');
}

Contributing

Contributions are welcome! If you have suggestions for improvements or new features, please open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgments

  • Thanks to the Dart and Flutter communities for their support and resources.