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

패키지 상세v1.2.0

flutter_cast_video

flutter_cast_video를 사용하면 Chrome Cast 및 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를 통해 최소한의 설정으로 장치 탐지 및 스트리밍 워크플로우를 간소화합니다.

사용 사례

  • 스마트 TV로 비디오 스트리밍
  • 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 개

소스 저장소

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

아직 데이터가 없습니다.