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
- Host: GitHub
- URL: https://github.com/sommye-ctr/video_cast
- Owner: sommye-ctr
- License: mit
- Created: 2023-01-17T20:42:47.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-08-02T06:54:42.000Z (over 1 year ago)
- Last Synced: 2025-03-26T12:11:48.015Z (10 months ago)
- Topics: cast, chromecast, dart, flutter
- Language: Dart
- Homepage:
- Size: 938 KB
- Stars: 7
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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.