Android Player SDK
Link to the Source code here: https://github.com/uizaio/uiza-android-player-sdk
Welcome to UIZA Android Player SDK
Simple Streaming at scale.
Uiza is the complete toolkit for building a powerful video streaming application with unlimited scalability. We design Uiza so simple that you only need a few lines of codes to start streaming, but sophisticated enough for you to build complex products on top of it.
Read CHANGELOG here.
Importing the Library
Step 1. Add the JitPack
repository to your build.gradle
file
Step 2. Add the dependency
For Android Support Compat (Support until January 2021)
Get latest release number HERE.
Additionally, if you want to use the Chromecast feature, add the following dependencies to your project:
if you use android support compat
If advertising support should be enabled, also add the following dependencies to your project:
Note:
The version of the ExoPlayer Extension IMA must match the version of the ExoPlayer library being used.
If you are using both ChromeCast and IMA Ads dependencies, we recommend using dependency
com.google.android.gms:play-services-cast-framework:$version
withversion >= 18.1.0
orversion=16.2.0
(support compat) to avoid dependency version conflicts
Check example here.
Turn on Java 8 support
If not enabled already, you need to turn on Java 8 support in all build.gradle
files depending on ExoPlayer, by adding the following to the android
section:
Node, Inside v1:
Init SDK
Init UZPlayer
If you want show log, install any
Tree
instances you want in theonCreate
of your application class
Manifest
How to play the video?:
XML
JAVA
Manifest
In your activity
or fragment
Play with entity:
Don't forget to add in activity life cycle event:
How to customize your skin?
Only 3 steps, you can customize everything about player skin.
Step 1: Create layout uzplayer_skin_custom.xml like THIS:
Please note app:controller_layout_id="@layout/uz_controller_custom_layout"
Step 2: Create layout uz_controller_custom_layout.xml like THIS:
In this xml file, you can edit anything you like: position, color, drawable resouces...
You can add more view (TextView, Button, ImageView...).
You can remove any component which you dont like.
Please note: Don't change any view
id
s if you are using it.
Step 3: On function onCreate()
of Activity
, put this code:
Ex:
Note: If you are using Chromecast, please use UZPlayer.setCasty(Activity activity) on function onCreate() of Activity
Ex: findView from your custom layout:
That's enough! This code above will change the player's skin quickly. You can build and run your app now.
But if you wanna change the player's skin when the player is playing, please you this function:
Note:
You should not change the id of the view. Ex:
android:id="@id/player_view"
Do not changeandroid:id="@id/player_view_0"
orandroid:id="@+id/player_view_0"
...
Picture In Picture (PIP)
You can use
UZDragView
, reviewPlayerActivity
From
Android Nougat
(Android SDK >= 24) Google supportedPIP
. To implement, inAndroidManifest.xml
addandroid:supportsPictureInPicture="true"
insideYour Activity
and reviewPIPPlayerActivity
.
R8 / ProGuard
Do not support R8
For contributors
Uiza Checkstyle configuration is based on the Google coding conventions from Google Java Style that can be found at here.
Your code must be followed the rules that defined in our uiza_style.xml
rules
You can setting the rules after import project to Android Studio follow below steps:
File > Settings > Editor > Code Style
Right on the
Scheme
, select the setting icon > Import Scheme > Intellij IDEA code style XMLSelect the
uiza_style.xml
file pathClick Apply > OK, then ready to go
For apply check style, install CheckStyle-IDEA plugin, then
File > Settings > Other Settings > Checkstyle
In Configuration file, select the
+
iconCheck
Use local checkstyle file
& select path touiza_check.xml
fileSelect OK & you're ready to go
To run checkstyle for project
Right click on project
Select Analyze > Inspect Code
Reference
Supported devices
Support all devices which have Android 5.0 (API level 21) above. For a given use case, we aim to support UizaSDK on all Android devices that satisfy the minimum version requirement.
Note: Some Android emulators do not properly implement components of Android’s media stack, and as a result do not support UizaSDK. This is an issue with the emulator, not with UizaSDK. Android’s official emulator (“Virtual Devices” in Android Studio) supports UizaSDK provided the system image has an API level of at least 23. System images with earlier API levels do not support UizaSDK. The level of support provided by third party emulators varies. Issues running UizaSDK on third party emulators should be reported to the developer of the emulator rather than to the UizaSDK team. Where possible, we recommend testing media applications on physical devices rather than emulators.
Error message
Check this class you can know error code and error message when use UZPlayer.
Support
If you've found an error in this sample, please file an issue
Patches are encouraged, and may be submitted by forking this project and submitting a pull request through GitHub. Please feel free to contact me anytime: developer@uiza.io for more details.
Address: 33 Ubi Avenue 3 #08- 13, Vertex Tower B, Singapore 408868 Email: developer@uiza.io Website: uiza.io
License
UizaSDK is released under the BSD license. See LICENSE for details.
Last updated