From d09c72245b207ccd38e35ef8dbb334e585082977 Mon Sep 17 00:00:00 2001 From: hpdragon Date: Sun, 28 Aug 2022 22:28:03 +0700 Subject: [PATCH] update README - add missing installation guild for android - add #buymeacoffee --- README.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) 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