How To Use

Welcome to UizaSDK

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 file

allprojects {
      repositories {
         maven { url '' }

Step 2. Add the dependency

defaultConfig {  
    multiDexEnabled  true
dependencies {  
    //for playing video VOD, LIVE  
    implementation 'com.github.uizaio.uiza-android-sdk-player:uizacoresdk:[lasted-release-number]'        
    //for live broadcaster  
    implementation 'com.github.uizaio.uiza-android-sdk-player:uizalivestream:[lasted-release-number]'  

Get lasted release number HERE.

If you are using uiza_android_sdk_player (Version 4.0.9 and above), you will need to import dependencies:

//for playing video VOD, LIVE
implementation 'com.github.uizaio.uiza-android-sdk-player:uizacoresdk:4.0.9'
implementation ''
implementation ''
implementation ''
  • Additionally, if you want to use the Chromecast feature, add the following dependencies to your project:

      //for Chromecast
      implementation ''
      implementation ''
  • If advertising support should be enabled, also add the following dependencies to your project:

      //for IMA Ads
      implementation ''
      implementation ''


  • 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 '$version' with version >= 16.0.3 to avoid dependency version conflicts

If you are using uiza_android_sdk_player (Version < 4.0.9), you only need to import dependencies:

//for playing video VOD, LIVE, Chromecast and advertising support
implementation 'com.github.uizaio.uiza-android-sdk-player:uizacoresdk:X.X.X'

Please note if your project uses firebase: firebase-core & firebase-database ... should be same version: Basically, you need to bump all Play Services and Firebase libraries to their latest version (which may be different for each since version 15).

You may use to find the latest version for each library. See also:

Check example here.

Init SDK

  1. appId : get in email at registration
  2. token : generate HERE.
  3. api : default is
 public class App extends MultiDexApplication {
        public void onCreate() {
            UZUtil.initWorkspace(this, 4, api, token, appId);


  android:name=".App "  <!-- important -->

How to call API?:

Call api by using this function**

UZService service = UZRestClient.createService(UZService.class);
UZAPIMaster.getInstance().subscribe(service.getListMetadata(), new ApiSubscriber<ResultGetListMetadata>() {
  public void onSuccess(ResultGetListMetadata resultGetListMetadata) {

  public void onFail(Throwable e) {

Other API can be used with the same function above.


This class help you know how to use all Uiza API, please refer to THIS

How to play the video?:


  android:layout_height="wrap_content" />


Create java file MainActivity:

public class MainActivity extends AppCompatActivity implements UZCallback{


  android:name=".MainActivity "
  android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize|uiMode" />

In onCreate() Play with entity:

uzVideo = (UZVideo) findViewById(;
UZUtil.initEntity(activity, uzVideo, "put the entity id here");

Play with playlist/folder:

UZUtil.initPlaylistFolder(activity, uzVideo, "put the playlist/folder id here");

Dont forget to add in activity life cycle event:

public void onDestroy() {

public void onResume() {

public void onPause() {

public void onActivityResult(int requestCode, int resultCode, Intent data) {
    uzVideo.onActivityResult(resultCode, resultCode, data);
    super.onActivityResult(requestCode, resultCode, data);

If you wanna listen all events of SDK, check the sample here.

This sample help you know how to use all Uiza SDK, please refer to THIS

More informations for AndroidTV, AndroidBox: You can use this SDK for AndroidTV, AndroidBox as well, but limited some features. We also provide some functions for AndroidTV like:

uzVideo.addUZTVCallback(this);//listen event onFocusChange of components.

Please take a look at module sampletv for more details.

How to customize your skin?:

Only 3 steps, you can customize everything about player skin.

Step 1: Create layout uiza_controller_skin_custom_main.xml like THIS:

Please note app:controller_layout_id="@layout/uiza_controller_skin_custom_detail"

Step 2: Create layout uiza_controller_skin_custom_detail.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: Dont change any id's view if you are using it.

Step 3:' On function onCreate() of Activity, put this code:



protected void onCreate(@Nullable Bundle savedInstanceState) {

Note: If you are using Chromecast, please use UZUtil.setCasty(Activity activity) on function onCreate() of Activity

protected void onCreate(@Nullable Bundle savedInstanceState) {

Ex: findView from your custom layout:

TextView tvSample = uzVideo.findViewById(;

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:


This sample help you know how to customize player's skin, please refer to THIS


  • You should not change the id of the view. Ex: android:id="@id/player_view" Do not change android:id="@id/player_view_0" or android:id="@+id/player_view_0"...

How to livestream with UizaSDK?:

It's very easy, plz follow these steps below to implement:


  android:layout_height="match_parent" />

In class LivestreamBroadcasterActivity:

public class LivestreamBroadcasterActivity extends AppCompatActivity implements UZLivestreamCallback {

func onCreate():

getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);  
getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
uzLivestream = (UZLivestream) findViewById(;  


protected void onResume() {  

Then put this line on surfaceChanged(UZLivestream.StartPreview startPreview);

int[] result = uzLivestream.getBestSizePreview();  
int width = result[0];  
int height = result[1];  
startPreview.onSizeStartPreview(width, height);


public void onPermission(boolean areAllPermissionsGranted) {  
    if (areAllPermissionsGranted) {  
       uzLivestream.setId("Put the entity id for livestream here");

Start a portrait livestream:

if (uzLivestream.prepareAudio() && uzLivestream.prepareVideoPortrait()) {  

To stream in landscape mode, use uzLivestream.prepareVideoLandscape() instead.

Start a livestream and save to MP4 file:

if (uzLivestream.prepareAudio() && uzLivestream.prepareVideoHD()) {  
    uzLivestream.startStream(uzLivestream.getMainStreamUrl(), true);  

Stop streaming (It auto saves mp4 file in your gallery if you start a livestream with option save local file)


Switch camera:


This sample help you know how to use all Uiza SDK for livestream, please refer to THIS



Supported devices

Support all devices which have Android 4.4 (API level 19) 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 UizaSDK.


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: for more details.

Address: 33 Ubi Avenue 3 #08- 13, Vertex Tower B, Singapore 408868


UizaSDK is released under the BSD license. See LICENSE for details.