https://github.com/opentok/opentok-flutter-basic-video-chat
https://github.com/opentok/opentok-flutter-basic-video-chat
Last synced: 18 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/opentok/opentok-flutter-basic-video-chat
- Owner: opentok
- Created: 2021-05-14T16:20:02.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-11-14T15:37:55.000Z (over 2 years ago)
- Last Synced: 2024-04-08T16:02:36.839Z (about 1 year ago)
- Language: Kotlin
- Size: 86.9 KB
- Stars: 11
- Watchers: 5
- Forks: 6
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
|
:warning: This repository is now deprecated :warning:
Please consider using [Vonage Community Video Flutter Sample App](https://github.com/Vonage-Community/sample-video-flutter-app) instead.
|
|-----------------------------------------|
# opentok-flutter-basic-video-chat
This repository is providing Basic video chat sample using OpenTok SDK and Flutter.
This project is a kick off projet to explore Flutter integration and it is not oficially supported by Vonage.
## Setup flutter SDK
Download, extract and confgure [flutter SDK](https://flutter.dev/docs/get-started/install).
Fortunately, flutter comes with a tool that allows us to verify if SDK and all required "components" are present and configured correctly. Run this command:
Check if everything is configured correctly:
```cmd
flutter doctor
```## Run the app
There are multiple ways to run the app. The easiest way is to open the whole project in the [Android Studio](https://developer.android.com/studio) with [Flutter plugin](https://flutter.dev/docs/development/tools/android-studio) installed. Open Flutter project (the root of this repo) and run app targetting one of the platforms.
Fill `OpenTokConfig`
Optionally you can open iOS project (`ios/Runner.xcworkspace` folder) in Xcode and run iOS app or Android project in Android Studio (`android` folder) and run Android App. This is possible because Flutter project consists of iOS and Android projects.
## Set up credentials
You will need a valid [TokBox account](https://tokbox.com/account/user/signup) for most of the sample projects. OpenTok credentials (`API_KEY`, `SESSION_ID`, `TOKEN`) are stored inside `OpenTokConfig` class (inside `main.dart` file). For these sample applications, credentials can be retrieved from the [Dashboard](https://dashboard.tokbox.com/projects) and hardcoded in the application, however for a production environment server should provide these credentials (check [Basic-Video-Chat](/Basic-Video-Chat) project).
> Note: To facilitate testing connect to the same session using [OpenTok Playground](https://tokbox.com/developer/tools/playground/) (web client).
## Known issuesWhen hosting the Native Android/iOS view in the Flutter app the [PlatformViewFactory](https://api.flutter.dev/javadoc/io/flutter/plugin/platform/PlatformViewFactory.html) must be used to create instance of the native view ([PlatformView](https://flutter.dev/docs/development/platform-integration/platform-views)). However Opentok SDK is creating views for video streams by itself. This means that we need a hack to be able to display opentok videos within the Flutter app. Instead of creating native view (using the `PlatformViewFactory`), app creates a container view (also using the `PlatformViewFactory`) and latter attaches Opentok video streams to this container. Unfortunately this solution requires to store view in the static property.
## Development and Contributing
Feel free to copy and modify the source code herein for your projects. Please consider sharing your modifications with us, especially if they might benefit other developers using the OpenTok Android SDK. See the [License](LICENSE) for more information.
Interested in contributing? You :heart: pull requests! See the
[Contribution](CONTRIBUTING.md) guidelines.## Getting Help
You love to hear from you so if you have questions, comments or find a bug in the project, let us know! You can either:
- Open an issue on this repository
- See for support options
- Tweet at us! We're [@VonageDev](https://twitter.com/VonageDev) on Twitter
- Or [join the Vonage Developer Community Slack](https://developer.nexmo.com/community/slack)## References
- [Basic Video chat Android](https://github.com/opentok/opentok-android-sdk-samples/tree/main/Basic-Video-Chat)
- [Basic Video chat iOS](https://github.com/opentok/opentok-ios-sdk-samples/tree/main/Basic-Video-Chat)
- [Basic Video chat Web](- [Basic Video chat Web](https://github.com/opentok/opentok-ios-sdk-samples/tree/main/Basic-Video-Chat))