Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/autokaka/rplayer
Lightweight Flutter RTSP low latency video player. Use DartFFI rather than MethodChannel.
https://github.com/autokaka/rplayer
audio dart dartffi ffmpeg flutter player rtsp video
Last synced: 3 months ago
JSON representation
Lightweight Flutter RTSP low latency video player. Use DartFFI rather than MethodChannel.
- Host: GitHub
- URL: https://github.com/autokaka/rplayer
- Owner: Autokaka
- License: bsd-3-clause
- Created: 2021-04-14T16:40:10.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-02T17:57:42.000Z (almost 3 years ago)
- Last Synced: 2023-03-08T20:22:51.400Z (almost 2 years ago)
- Topics: audio, dart, dartffi, ffmpeg, flutter, player, rtsp, video
- Language: C++
- Homepage: https://github.com/Autokaka/rplayer
- Size: 104 MB
- Stars: 12
- Watchers: 2
- Forks: 9
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# RPlayer
Flutter RTSP low latency video player for Android TV only. This player is intended to use FFmpeg under the hood to decode RTSP streams and Android SurfaceView to draw in native code. If time permits, I'll try to use OpenGLES as its backend renderer and OpenSLES as its audio solution. For now I only achieved video decode part.
## Minimal example
```dart
@override
void initState() {
super.initState();
player.startPlayWhenReady('rtsp://admin:[email protected]:8554/live');
}@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('RPlayer Video Test Page'),
),
body: RPlayerView(
player: player,
width: MediaQuery.of(context).size.width,
height: 300,
),
);
}@override
void dispose() {
player.dispose();
super.dispose();
}
```## Design
### RPlayerConfig
RPlayerConfig configures how videos will be played. You could only create a RPlayerConfig instance like this:
```dart
var rplayerConfig = RPlayerConfig()
..retryTimesOnDisconnect = 10
..retryDelayInMilliseconds = 2000
..preferHardcodec = 1;
```- **retryTimesOnDisconnect**: Determine how many times the player will retry to connect when stream is closed.
- **retryDelayInMilliseconds**: Determine how long (in milliseconds) before the player make next reconnection when stream is closed.
- **preferHardcodec**: If set to `true`, the player will try to ask for a hardcodec first before playing video if ROM permits. If failed to allocate hardcodec, player will fallback to use a softcodec to play video.### RPlayerState
RPlayerState exposes the inner state of RPlayer. The states are as follows:
- **INIT**:
- STOPPED:
- BUFFERING:
- PLAYING: