bluecherrydvr / unity

[work-in-progress] Bluecherry DVR client to run across range of devices. ๐Ÿ’™
GNU General Public License v3.0
24 stars 4 forks source link
android bluecherry bluecherry-client cross-platform flutter hacktoberfest ios material-design

Bluecherry Client


Bluecherry DVR client to run across range of devices.
Website โ€ข Purchase โ€ข Chat

Features

Download

Android iOS Windows GNU/Linux MacOS
arm64 .apk App Store Windows Setup ๐Ÿšง SOON AppImage Executable .app
armabi .apk ๐Ÿšง SOON winget install bluecherry Ubuntu/Debian .deb ๐Ÿšง SOON App Store
x86_64 .apk ๐Ÿšง SOON Microsoft Store Raw Executable .tar.gz
๐Ÿšง SOON Play Store Fedora/Red Hat Linux .rpm

Or download the latest release here.

Installation

Most platforms will not require any extra steps to install the app.

Linux

To install the .deb file, run:

sudo dpkg -i bluecherry-linux-x86_64.deb

Usage

Refer to USAGE.md for detailed usage instructions.

License

Copyright ยฉ 2022, Bluecherry DVR.

This project & work under this repository is licensed under GNU General Public License v3.0.

Bug-Reports

Send us details about any issues you discover in the issues or in the forums.

Contribute

Translate

You may provide translations for the application to see it running in your own language. Please follow these steps:

Let's say, we're adding French (fr) translation.

  1. Fork the repository & navigate here.
  2. Create a new file named app_fr.arb.
  3. Add your translations to your new app_fr.arb file in correspondence to existing English translations.
  4. Send us a new pull-request. ๐ŸŽ‰

When adding new strings, run bin/l10n_organizer.dart. This script will ensure that the new strings are added to all l10n files and that they are in the same location. It will also remove any unused strings. The base file is app_en.arb, so all strings must be added there first.

Note that the app is constantly changing and new strings are added all the time. The translations need to be updated constantly.

Technical Details

The code uses Provider for state-management because it is widely known by Flutter community, doesn't bring any unnecessary complexity to the codebase & is scalable/stable enough.

Most ChangeNotifiers are available as singletons, though de-coupled from each other. This is important to handle things like loading app configuration before runApp, handling background notification button actions & few other asynchronous operations performed outside the widget tree. By having singletons, we are able to avoid a strict dependency on the BuildContext & do certain things in a more performant way.

Current source tree has following files:

lib
โ”‚
โ”œโ”€โ”€โ”€api                                                [API wrapper around Bluecherry DVR server.]
โ”‚   โ””โ”€โ”€api.dart
โ”‚   โ””โ”€โ”€ptz.dart  [API related to Pan-Tilt-Zoom controls]
โ”‚
โ”œโ”€โ”€โ”€l10n [Tranlations]
โ”‚
โ”œโ”€โ”€โ”€models                                             [model classes to serve & bind type-safe data together in various entities.]
โ”‚   โ”œโ”€โ”€โ”€device.dart
โ”‚   โ”œโ”€โ”€โ”€event.dart
โ”‚   โ”œโ”€โ”€โ”€layout.dart
โ”‚   โ””โ”€โ”€โ”€server.dart
โ”‚
โ”œโ”€โ”€โ”€providers                                          [core business logic of the application.]
โ”‚   โ”œโ”€โ”€โ”€desktop_view_provider.dart                     [stores, provides & caches desktop camera layout]
โ”‚   โ”œโ”€โ”€โ”€downloads_provider.dart                        [manages events downloading and progress]
โ”‚   โ”œโ”€โ”€โ”€events_playback_provider.dart                  [caches data about the events playback view]
โ”‚   โ”œโ”€โ”€โ”€home_provider.dart                             [stores, provides & caches data about the home page]
โ”‚   โ”œโ”€โ”€โ”€mobile_view_provider.dart                      [stores, provides & caches mobile camera layout etc.]
โ”‚   โ”œโ”€โ”€โ”€server_provider.dart                           [stores, provides & caches multiple DVR servers added by the user.]
โ”‚   โ””โ”€โ”€โ”€settings_provider.dart                         [stores, provides & caches various in-app configurations & settings.]
โ”‚   โ””โ”€โ”€โ”€update_provider.dart                           [manages app updates and app status.]
โ”‚
โ”œโ”€โ”€โ”€utils                                              [constant values, helper functions & theme-related stuff.]
โ”‚   โ”œโ”€โ”€โ”€constants.dart
โ”‚   โ”œโ”€โ”€โ”€extensions.dart
โ”‚   โ”œโ”€โ”€โ”€methods.dart
โ”‚   โ”œโ”€โ”€โ”€storage.dart
โ”‚   โ”œโ”€โ”€โ”€theme.dart
โ”‚   โ”œโ”€โ”€โ”€video_player.dart
โ”‚   โ””โ”€โ”€โ”€window.dart
โ”‚
โ”œโ”€โ”€โ”€screens                                            [All the screens of the application.]
โ”‚
โ”œโ”€โ”€โ”€widgets                                            [UI/UX & widgets used to display content.]
โ”‚
โ”œโ”€โ”€โ”€firebase_messaging_background_handler.dart         [handles in-app notifications, snoozing, thumbnails etc. & other Firebase related hooks.]
โ”œโ”€โ”€โ”€firebase_options.dart                              [auto-generated firebase configuration.]
โ””โ”€โ”€โ”€main.dart                                          [entry-point of the application.]

packages
โ”‚
โ”œโ”€โ”€โ”€unity_multi_window                                 [multi-window support for desktop platforms.]
โ”‚
โ”œโ”€โ”€โ”€unity_video_player
โ”‚   โ”œโ”€โ”€โ”€unity_video_player                             [the core video player logic.]
โ”‚   โ”œโ”€โ”€โ”€unity_video_player_flutter                     [video player used as fallback, used on embedded platforms.]
โ”‚   โ”œโ”€โ”€โ”€unity_video_player_main                        [main video player logic, used on most platforms.]
โ”‚   โ”œโ”€โ”€โ”€unity_video_player_platform_interface          [the platform interface for the video player.]
โ”‚   โ””โ”€โ”€โ”€unity_video_player_web                         [web specific video player logic, used on web.]

Feel free to send any pull-requests to add any features you wish or fix any bugs you notice.

Video Rendering

We support multiple platforms and each platform uses its own rendering backend.

Platform Rendering Backend Flutter Package
Android MPV media_kit
iOS MPV media_kit
Windows MPV media_kit
MacOS MPV media_kit
Web HTML5 fvp
Linux MDK fvp
Raspberry Pi MDK fvp

MDK is used for Linux and Raspberry Pi because MPV has shown to be unstable on these platforms, causing crashes. Additionally, fvp doesn't require the user to install any additional dependencies.

Build

The build process is pretty straight-forward. You need to have Flutter installed on your system.

git clone https://github.com/bluecherrydvr/unity
cd unity
flutter pub get
flutter build [linux|windows|macos|android|ios]

The automated build process is done using GitHub Actions. You may find the workflow here. The workflow builds the app for all supported platforms & uploads the artifacts to the release page.

Linux

On Linux, a Flutter executable with different environment variables is used to build the app for different distributions. This tells the app how the system is configured and how it should install updates. To run for Linux, you need to provide the following environment variables based on your system, where [DISTRO_ENV] can be appimage (AppImage), deb (Ubuntu/Debian), rpm (RedHat), tar.gz (Tarball) or pi (Raspberry Pi).

flutter run -d linux --dart-define-from-file=linux/env/[DISTRO_ENV].json

Web

When running on debug, you must disable the CORS policy in your browser. Note that this is only for debugging purposes and should not be used in production. To do this, run the following command:

flutter run -d chrome --web-browser-flag "--disable-web-security"