diff --git a/README.md b/README.md index 14e9ae0..d82ed08 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ A GStreamer-powered alternative to Flutter's video_player that support Linux and ![](doc/screenshot.png) +Buy Me A Coffee + ## Installation ### Linux @@ -14,7 +16,24 @@ Follow GStreamer's [Install on Linux](https://gstreamer.freedesktop.org/document Follow GStreamer's [Install on Android](https://gstreamer.freedesktop.org/documentation/installing/for-android-development.html?gi-language=c) instuction. -This source code has been tested with gstreamer 1.20.1 [prebuild binary](https://gstreamer.freedesktop.org/data/pkg/android/) +In Android, you need to init GStreamer in main activity of your flutter application. +In your flutter application, edit `MainActivity.kt` or `MainActivity.java` file, depends on your flutter config +(This file is usually located at `android/app/src/main//MainActivity.kt`). +Import GStreamer module and override `onCreate` of `MainActivity` class to init GStreamer, the end result should looks like bellow. + +``` +import org.freedesktop.gstreamer.GStreamer + +class MainActivity: FlutterActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + GStreamer.init(this); + } +} +``` + +This source code has been tested with GStreamer 1.20.1 [prebuild binary](https://gstreamer.freedesktop.org/data/pkg/android/) ## Getting Started