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

パッケージ詳細v1.2.0

flutter_cast_video

flutter_cast_video を使用すると、Chromecast や Apple TV などのキャストデバイスを検出して接続できます。

AndroidiOS
30日間ダウンロード
213
いいね数
35
Pub ポイント
140

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

flutter pub add flutter_cast_video

パッケージ概要

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

flutter_cast_video は、Chrome Cast や Apple TV などのキャスティングデバイスの検出と接続を可能にする Flutter パッケージです。モバイルアプリからメディアコンテンツを互換性のあるディスプレイにストリーミングでき、より大きな画面での視聴体験を向上させます。このパッケージは Android および iOS プラットフォームをサポートしており、アプリにキャスティング機能を追加したい開発者にとってシームレスな統合を提供します。pub add を通じた最小限の設定で、デバイス検出とストリーミングワークフローを簡素化します。

用途

  • スマートテレビへの動画ストリーミング
  • Apple TVでリモート再生を有効にする
  • メディアアプリへのキャスティングの統合
  • マルチデバイスのキャストをサポート
  • ライブコンテンツのミラーリングを許可する
  • ホームエンターテインメントアプリの促進

主な機能

  • Chromecast および Apple TV のデバイス検出
  • クロスプラットフォーム対応(Android および iOS)
  • pub add との簡単な統合
  • リアルタイムのキャスティング機能
  • 組み込み接続管理
  • セキュアなストリーミングプロトコル

適している対象

  • メディアおよび動画ストリーミングアプリ
  • スマートホームエンターテイメントシステム
  • 教育用またはプレゼンテーション用アプリ
  • 大画面表示向けのアプリ
  • 開発者が迅速にキャスティング機能を追加しています

注意事項

  • 互換性のあるキャストデバイスが必要です
  • ネットワーク接続は必須です
  • サポートされているプラットフォームに限定
  • 追加の権限が必要になる場合があります
  • デバイスの利用可能性に依存します
  • ユーザーはターゲットデバイスを手動で選択する必要があります

元の README

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

flutter_cast_video

This is a clone and enhanced version from fluter_video_cast

A Flutter plugin for iOS and Android for connecting to cast devices like Chromecast and Apple TV.

Installation

First, add flutter_cast_video as a dependency in your pubspec.yaml file.

iOS

Set the minimum os target to iOS 11.0.

Initialize the Cast context in the application delegate ios/Runner/AppDelegate.m:

import UIKit
import Flutter
import GoogleCast

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate, GCKLoggerDelegate {
    let kReceiverAppID = kGCKDefaultMediaReceiverApplicationID
    let kDebugLoggingEnabled = true

    override func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {
        GeneratedPluginRegistrant.register(with: self)
        let criteria = GCKDiscoveryCriteria(applicationID: kReceiverAppID)
        let options = GCKCastOptions(discoveryCriteria: criteria)
        GCKCastContext.setSharedInstanceWith(options)
        GCKCastContext.sharedInstance().useDefaultExpandedMediaControls = true
        GCKLogger.sharedInstance().delegate = self
        return super.application(application, didFinishLaunchingWithOptions: launchOptions)
    }
}

Opt-in to the embedded views preview by adding a boolean property to the app's Info.plist file with the key io.flutter.embedded_views_preview and the value YES.

Android

Add dependencies in your module (app-level) Gradle file (usually android/app/build.gradle):

implementation 'com.google.android.gms:play-services-cast-framework:19.0.0'
implementation 'com.google.android.exoplayer:extension-cast:2.11.5'

Set the theme of the MainActivity to @style/Theme.AppCompat.NoActionBar in the application manifest android/app/src/main/AndroidManifest.xml:

<manifest ...
  <application ...
    <meta-data android:name="com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME"
               android:value="com.google.android.exoplayer2.ext.cast.DefaultCastOptionsProvider"/>
    ...
    <activity android:theme="@style/Theme.AppCompat.NoActionBar" ...

Make MainActivity extends FlutterFragmentActivity and initialize the Cast context:

CastContext.getSharedInstance(applicationContext)
Both

You can now add a ChromeCastButton widget to your widget tree.

The button can be controlled with the ChromeCastController that is passed to the ChromeCastButton's onButtonCreated callback.

import 'package:flutter/material.dart';
import 'package:flutter_cast_video/flutter_cast_video.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: CastSample(),
    );
  }
}


class CastSample extends StatefulWidget {
  @override
  _CastSampleState createState() => _CastSampleState();
}

class _CastSampleState extends State<CastSample> {
  ChromeCastController _controller;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Cast Sample'),
        actions: [
          ChromeCastButton(
            onButtonCreated: (controller) {
              setState(() => _controller = controller);
              _controller?.addSessionListener();
            },
            onSessionStarted: () {
              _controller?.loadMedia('https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4');
            },
          ),
        ],
      ),
    );
  }
}

See the example directory for a complete sample app.

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

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

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