aws_ivs_player 0.1.0
aws_ivs_player: ^0.1.0 copied to clipboard
A modern AWS IVS Player SDK implementation for Flutter with cross-platform support for live and on-demand video streaming.
IVS Player - Flutter Package #
A Flutter package for AWS Interactive Video Service (IVS) integration. This package provides a complete solution for streaming live and on-demand video content in Flutter applications using Amazon's IVS platform.
📱 Flutter Package - Designed specifically for Flutter applications on iOS and Android
What is this? #
This is a Flutter package that wraps the AWS Interactive Video Service (IVS) SDK, allowing you to easily integrate live video streaming into your Flutter apps. Simply add it to your pubspec.yaml and start streaming!
Package Features #
- ✅ Flutter Package - Easy integration via pub.dev
- ✅ Modern AWS IVS SDK - Updated to latest SDK versions (1.29.0)
- ✅ Cross-platform Flutter support - iOS and Android
- ✅ Flutter-native widgets -
IvsVideoPlayerwidget ready to use - ✅ State management - Built-in player state tracking with Flutter ChangeNotifier
- ✅ Error handling - Comprehensive error handling and retry mechanisms
- ✅ Customizable Flutter UI - Configurable controls and loading states
- ✅ Responsive Flutter design - Adaptive to different screen sizes
- ✅ Modern Flutter patterns - Uses latest Flutter best practices
Installation #
Add to your Flutter project's pubspec.yaml:
dependencies:
ivs_player: ^1.0.0
Then run in your Flutter project:
flutter pub get
Platform Requirements #
iOS #
- Minimum iOS Version: 13.0
- Xcode: 14.0 or later
- Amazon IVS Player: 1.29.0
Android #
- Minimum SDK: 21 (Android 5.0)
- Target SDK: 34 (Android 14)
- Compile SDK: 34
- Amazon IVS Player: 1.29.0
Setup #
iOS Setup #
cd ios && pod install
Android Setup #
The Android setup is handled automatically via Gradle.
Usage in Flutter #
Basic Flutter Widget Usage #
import 'package:flutter/material.dart';
import 'package:ivs_player/ivs_player.dart';
class MyVideoPlayer extends StatelessWidget {
const MyVideoPlayer({super.key});
@override
Widget build(BuildContext context) {
return IvsVideoPlayer(
url: 'https://your-ivs-stream-url.m3u8',
width: 400,
height: 225,
autoPlay: true,
);
}
}
Advanced Flutter Usage with Controller #
class MyVideoPage extends StatefulWidget {
const MyVideoPage({super.key});
@override
State<MyVideoPage> createState() => _MyVideoPageState();
}
class _MyVideoPageState extends State<MyVideoPage> {
final IvsPlayerController _controller = IvsPlayerController();
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Column(
children: [
IvsVideoPlayer(
url: 'https://your-ivs-stream-url.m3u8',
controller: _controller,
autoPlay: true,
showOverlayControls: true,
onError: (error) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Error: $error')),
);
},
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () => _controller.play('https://new-stream-url.m3u8'),
child: const Text('Play'),
),
ElevatedButton(
onPressed: () => _controller.pause(),
child: const Text('Pause'),
),
ElevatedButton(
onPressed: () => _controller.stop(),
child: const Text('Stop'),
),
],
),
],
);
}
}
Configuration #
iOS (Info.plist) #
Add the following to your Info.plist for network permissions:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
</dict>
Android (AndroidManifest.xml) #
Add internet permission:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Flutter Package API Reference #
IvsVideoPlayer Flutter Widget #
| Property | Type | Description |
|---|---|---|
url |
String | The AWS IVS stream URL |
controller |
IvsPlayerController? | Optional controller for programmatic control |
autoPlay |
bool | Whether to start playing automatically |
showOverlayControls |
bool | Whether to show interactive overlay controls |
loadingWidget |
Widget? | Custom loading widget |
errorWidget |
Widget? | Custom error widget |
onError |
Function(String)? | Error callback |
IvsPlayerController #
| Method | Description |
|---|---|
play(String url) |
Start playing the specified URL |
pause() |
Pause the current playback |
resume() |
Resume paused playback |
stop() |
Stop playback and dispose native resources |
dispose() |
Clean up all resources |
| Property | Type | Description |
|---|---|---|
state |
PlayerState | Current player state |
currentUrl |
String? | Currently loaded URL |
errorMessage |
String? | Last error message |
hasError |
bool | Whether there's an active error |
PlayerState Enum #
idle- Player is idleloading- Player is loading contentready- Player is ready to playplaying- Player is actively playingpaused- Player is pausederror- Player encountered an errordisposed- Player has been disposed
Testing #
Test Stream URLs #
You can use these test URLs for development:
// AWS IVS Test Stream
const testStream = 'https://fcc3ddae59ed.us-west-2.playback.live-video.net/api/video/v1/us-west-2.893648527354.channel.DmumNckWFTqz.m3u8';
// Your own IVS streams from AWS Console
const yourStream = 'https://your-unique-stream-url.m3u8';
Flutter Development & Troubleshooting #
Common Flutter Package Issues #
-
"Flutter package not found"
- Run
flutter pub getto install the package - Check that
ivs_playeris correctly added topubspec.yaml - Restart your IDE/editor
- Run
-
"Video not playing in Flutter app"
- Ensure the stream URL is valid and accessible
- Check network permissions in your Flutter app
- Verify AWS IVS permissions and policies
-
"Flutter build errors"
- Run
flutter cleanandflutter pub get - For iOS:
cd ios && pod install --repo-update - For Android: Ensure you have the latest Android SDK
- Run
-
"Flutter app crashes on startup"
- Check minimum iOS/Android versions
- Verify all permissions are granted
- Check AWS IVS SDK compatibility
- Ensure you're using a compatible Flutter version
Debug Mode #
Enable debug logging by setting:
import 'dart:developer' as developer;
developer.log('IVS Player Debug: $message', name: 'IVSPlayer');
Contributing #
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License #
This project is licensed under the MIT License - see the LICENSE file for details.
Support #
For AWS IVS-specific issues:
For Flutter-specific issues: