If you want to play around with the code, implement a new feature or just run the example apps, follow along with this section. If you just want to use the player in your own flutter app, you can skip this and follow the instructions in the Getting Started Guide section.
- Install
flutter
on your machine - Install
Node.js
andnpm
on your machine - Run
npm ci
in the root of the cloned repository- This will setup husky powered pre-commit git hooks
- Run
brew bundle install
in the root of the cloned repository to install needed dependencies:ktlint
for linting Kotlin codeswiftlint
for linting Swift code
- Follow instructions under Example App and Integration Tests in order to have a fully working project setup, where the linter commands from the pre-commit hook succeeds
To build the example project with your own developer account, create the config file
example/ios/Flutter/Developer.xcconfig
. In this file, add your development team like this:
DEVELOPMENT_TEAM = YOUR_TEAM_ID
To be able to use the example app, follow these steps:
- Create a file named
.env
in the project root - Put your private Bitmovin Player license key inside the newly created
.env
file asBITMOVIN_PLAYER_LICENSE_KEY=YOUR_LICENSE_KEY
, replacingYOUR_LICENSE_KEY
with your license key which can be obtained from Bitmovin's Dashboard - If you also want to enable Bitmovin Analytics, additionally add your private Bitmovin Analytics license key to the
.env
file asBITMOVIN_ANALYTICS_LICENSE_KEY=YOUR_ANALYTICS_LICENSE_KEY
, replacingYOUR_ANALYTICS_LICENSE_KEY
with your Analytics license key which can be obtained from Bitmovin's Dashboard - In the Dashboard, add
com.bitmovin.player.flutter.example
as an allowed package name for your Player license and optionally for your Analytics license - Run
flutter pub get
in the project root, if not done already - Run
dart run build_runner build --delete-conflicting-outputs
in the project root which should generate the missingexample/lib/env/env.g.dart
file - Start the example app by running the command
flutter run
inside theexample/
directory- If you see an error that signing for "Runner" requires a development team, follow the instructions in the section for getting started with iOS development
Before creating a pull request, please
- Make sure all guidelines are followed
- Make sure your branch is free of merge conflicts
- Code needs to be free of linter errors. Linting is done via a pre-commit git hook for Dart, Kotlin and Swift code. Linter commands that are used by the pre-commit hook:
- Dart:
flutter analyze
- Kotlin:
ktlint
- Swift:
swiftlint --strict
- Dart:
- Public API that is exported via
lib/bitmovin_player.dart
has to be documented with a description that explains what it does - Every code block that does not obviously explain itself should be commented with an explanation of why and what it does
While this is not enforced, feel free to follow the conventional commits specification for commit messages:
fix
: bug fixes, e.g. fix crash due to deprecated method.feat
: new features, e.g. add new method to the module.refactor
: code refactor, e.g. migrate from class components to hooks.docs
: changes into documentation, e.g. add usage example for the module..test
: adding or updating tests, e.g. add integration tests using detox.chore
: tooling changes, e.g. change CI config.
This project uses json_serializable
to deal with JSON. After creating
a new symbol that needs JSON serialization or modifying an existing one, run the following command to generate the new or updated JSON
part files:
dart run build_runner build --delete-conflicting-outputs
If generating the JSON part files fails consistently, try to clean the project beforehand:
flutter clean && flutter pub get
Integration tests are located under example/integration_test/
. New integration tests should be added there for new
features that get implemented.
The tests can be executed either through VSCode or by running flutter test integration_test
in the example/
directory.
Integration tests for the player SDK are written using a separate player testing framework which is located
under player_testing/
.
Before integration tests can be executed for the first time, a few set-up steps are needed:
- Create a file named
.env
insideplayer_testing
- Put your private Bitmovin Player license key inside the newly created
.env
file asBITMOVIN_PLAYER_LICENSE_KEY=YOUR_LICENSE_KEY
, replacingYOUR_LICENSE_KEY
with your license key which can be obtained from Bitmovin's Dashboard- If you already created an
.env
file in the project root, you can just copy it over toplayer_testing
- If you already created an
- Run
dart pub get
insideplayer_testing
, if not done already - Run
dart run build_runner build
insideplayer_testing
which should generate the missingplayer_testing/lib/env/env.g.dart
file - Execute the integration tests by running
flutter test integration_test
in theexample/
directory