パッケージ、リポジトリ、アプリカテゴリを検索

youtube_api のカバー
パッケージ詳細v1.0.4

youtube_api

YouTubeAPI は、YouTube サーバーと直接やり取りするプラグインです。動画およびプレイリストの検索をサポートしています。

30日間ダウンロード
143
いいね数
85
Pub ポイント
100

パッケージをインストール

flutter pub add youtube_api

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

YouTubeAPI は、Flutter プラグインであり、YouTube サーバーとの直接的な相互作用を可能にし、開発者が動画やプレイリストを検索できるようにします。シンプルさと効率性を重視して構築されており、Flutter アプリケーションにスムーズに統合され、複雑なセットアップなしで YouTube の主要な検索機能にアクセスできます。このプラグインは nstack.in によってメンテナンスされており、GitHub にホストされているため、オープンソースの貢献が可能です。Android および iOS プラットフォームをサポートしていますが、メタデータには具体的なプラットフォームの詳細は記載されていません。

用途

  • アプリにYouTube動画検索を統合する
  • プログラムでプレイリストデータを取得する
  • メディア発見機能の構築
  • 動画推薦システムの作成
  • ユーザー主導のコンテンツ探索の有効化

主な機能

  • 直接YouTubeサーバー通信
  • 動画およびプレイリスト検索機能
  • Flutter とのシンプルな統合
  • GitHub 上のオープンソースコードベース
  • クロスプラットフォーム対応(Android/iOS)

適している対象

  • メディア豊富なFlutterアプリを開発する開発者
  • YouTubeコンテンツの発見を必要とするアプリ
  • リアルタイム動画検索が必要なプロジェクト
  • 動画ツールのオープンソース貢献者
  • 教育またはエンターテインメントアプリの作成者

注意事項

  • API呼び出しにはインターネット接続が必要です
  • YouTubeのパブリックAPIの利用可能性に依存します
  • 本番環境での利用にはAPIキーの設定が必要になる場合があります
  • 検索機能に限定(再生制御なし)
  • メタデータに公式ドキュメントが提供されていません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

YouTube API Client (youtube_api_client)

Forked (all restructured and improved) from youtube_api

A Flutter plugin for fetching interacting with YouTube Server to fetch data using API. Supports iOS and Android.

Features:

  • Search Video, Playlist, Channel on YouTube (query by keywords or by ID)
  • Get Trending Videos based on region code.

Usage

To use this plugin, add youtube_api_client as a dependency in your pubspec.yaml file.

Complete Example Code

Example
static String key = "YOUR_API_KEY";
final youtube = YoutubeApi(_key);
List<ApiResult> result = [];

Search for videos, channels and playlists

String query = "Flutter";
result = await youtube.search(query);
// data which are available in result is typed as in the example shown below

By default the search options are like the following:

SearchOptions options = const SearchOptions(
      type: ResultType.values,
      order: Order.relevance,
      videoDuration: VideoDuration.any,
    )

But you can customize them changing the parameter options. For example, if you want to get only results for channels, you can specify like so:

SearchOptions(type: ResultType.channel)

To get Trending videos in your Country-

regionCode='YOUR_COUNTRY_REGION_CODE(apha-2)';
result = await youtube.getTrends(regionCode);
//make sure you assign alpha-2 region code

To get results by id use searchVideosById, searchChannelsById, and searchPlaylistsById.

result = await youtube.searchVideosById(idList);

You can find your Country Region Code here

By default, it retrieves only the "snippet" data, which has enough information for most of the cases.

For example the snippet for a video contains:

  1. title (String)
  2. description (String)
  3. publish date (DateTime)
  4. channel ID (String)
  5. channel title (String)
  6. thumbnails (Map<ThumbnailResolution, Thumbnail> - custom classes)
  7. video category (Category - enum)
  8. tags (List)
  9. default language (String)
  10. defaultAudioLanguage (String)
  11. live broadcast content (LiveBroadcastContent - enum)

If you need more information from the API, you can add other parts in the query. For now it has only the part "snippet" and "content details" (containing: duration, dimension, definition, caption, licensed content, and projection). The original API has lots more of information, so you are welcome to help implementing those making pull requests.

Motivation

The original package seems to be abandoned. I improved a lot its code, making it more typed, and added more features.

カテゴリー

依存関係

依存関係一覧 2 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。