An open API service indexing awesome lists of open source software.

https://github.com/sommye-ctr/video_cast

Flutter plugin for casting videos on chromecast devices
https://github.com/sommye-ctr/video_cast

cast chromecast dart flutter

Last synced: 6 months ago
JSON representation

Flutter plugin for casting videos on chromecast devices

Awesome Lists containing this project

README

          

# video_cast

Flutter plugin for casting videos on chromecast devices

This is a modified version of [flutter_video_cast](https://pub.dev/packages/flutter_video_cast_v2) with extra features

## Installation

First, add `video_cast` as a [dependency in your pubspec.yaml file](https://flutter.io/using-packages/).

### Android

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

```groovy
implementation 'com.google.android.gms:play-services-cast-framework:21.2.0'
implementation 'com.google.android.exoplayer:extension-cast:2.17.1'
```

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

```xml

...
_CastSampleState();
}

class _CastSampleState extends State {
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: () {
castController?.loadMedia(
url:
"https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
position: 30000,
autoplay: true,
title: "Spider-Man: No Way Home",
description:
"Peter Parker is unmasked and no longer able to separate his normal life from the high-stakes of being a super-hero. When he asks for help from Doctor Strange the stakes become even more dangerous, forcing him to discover what it truly means to be Spider-Man.",
image:
"https://terrigen-cdn-dev.marvel.com/content/prod/1x/marvsmposterbk_intdesign.jpg",
type: ChromeCastMediaType.movie,
);
},
),
],
),
);
}
}
```

See the `example` directory for a complete sample app.