Example of using YouTube Live Streaming API v3 on Android (Kotlin).
Were also used:
- Google Java API Client Services
- Google Sign-In.
- MVVM pattern
- Coroutines (Multithreading async operations)
- YouTube Android Player API
To use this application,
- Enable YouTube Live Streaming for your channel.
- In your Google Developers Console,
- Enable the YouTube Data API v3 (from the Library)
- Create a client ID for Android, using your SHA1 and package name.
For the YouTube Player API needed API key:
- On the Credentials page (look for on the console) copy API Key
- Open Credentials_.kt file (util folder). Replace the parameter "API Key" with Past API from the previous step. Close the file.
- Rename file Credentials_.kt to Credentials.kt
Demo video
- Create a new stream on your YouTube account:
- There are All, Upcoming, Active, Completed life cycle broadcasts. Watch current (active) stream.
There is an example of using the same API on iOS: YTLiveStreaming for iOS.