패키지, 저장소 및 앱 카테고리 검색

패키지 상세v1.0.3

flutter_video_cast

flutter_video_cast를 사용하면 Chrome Cast 및 Apple TV와 같은 캐스트 장치를 탐색하고 연결할 수 있습니다.

30일 다운로드
35
좋아요
50
Pub 점수
40

패키지 설치

flutter pub add flutter_video_cast

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

flutter_video_cast는 Chrome Cast 및 Apple TV와 같은 캐스트 장치를 탐지하고 연결할 수 있도록 해주는 Flutter 패키지입니다. 사용자는 Flutter 애플리케이션에서 호환되는 디스플레이 장치로 비디오 콘텐츠를 스트리밍할 수 있으며, 스마트 TV 및 스트리밍 하드웨어 간의 미디어 공유를 향상시킵니다. 기존의 Flutter 프로젝트에 원활하게 통합되며, 장치 감지 및 세션 관리를 지원합니다. 대형 화면으로 재생을 확장하려는 미디어 중심 앱 개발자에게 이상적입니다.

사용 사례

  • 스마트 TV로 스트리밍 비디오 전송
  • 원격 재생 제어
  • 모바일 앱에서 미디어 캐스팅
  • 라이브 비디오 미러링
  • 다기기 호환성
  • 크로스 플랫폼 캐스팅

주요 기능

  • 장치 탐지
  • 캐스트 세션 관리
  • Chrome Cast 및 Apple TV 지원
  • Flutter와의 간단한 통합
  • 실시간 장치 상태 업데이트
  • 크로스 플랫폼 기능

적합한 대상

  • 미디어 및 엔터테인먼트 앱
  • 스마트 홈 통합
  • 비디오 회의 도구
  • 교육 콘텐츠 플랫폼
  • 사물인터넷 장치 컨트롤러
  • 화면 미러링이 필요한 앱

고려 사항

  • 호환되는 캐스트 기기 필요
  • 네트워크 연결이 필수적입니다
  • 지원되는 플랫폼에 한정
  • 추가 권한이 필요할 수 있습니다
  • 외부 SDK에 의존합니다
  • 내장된 미디어 플레이어 없음

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

flutter_video_cast

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

Installation

First, add flutter_video_cast 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_video_cast/flutter_video_cast.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 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.