Sample apps for the Bitmovin Player Android SDK
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
BasicAds Replace compile statements with implementation in gradle files Aug 21, 2018
BasicCasting Replace compile statements with implementation in gradle files Aug 21, 2018
BasicDRMPlayback Replace compile statements with implementation in gradle files Aug 21, 2018
BasicFullscreenHandling Add BasicFullscreenHandlig sample Aug 30, 2018
BasicMetadataHandling Replace compile statements with implementation in gradle files Aug 21, 2018
BasicPlayback Replace compile statements with implementation in gradle files Aug 21, 2018
BasicPlayerFragment Add BasicPlayerFragment sample Sep 5, 2018
BasicPlaylist Improve code documentation Sep 3, 2018
BasicVrPlayback Replace compile statements with implementation in gradle files Aug 21, 2018
CustomHtmlUi Replace compile statements with implementation in gradle files Aug 21, 2018
CustomUi Replace compile statements with implementation in gradle files Aug 21, 2018
CustomUiSubtitleView Correct resource reference in CustomUiSubtitleView sample Sep 7, 2018
OfflinePlayback Replace compile statements with implementation in gradle files Aug 21, 2018
gradle/wrapper Update gradle plugin and wrapper Apr 4, 2018
.gitignore Initial commit May 18, 2017
README.md Update sample applications to use Bitmovin Player SDK 2.14.0 Sep 7, 2018
build.gradle Update sample applications to use Bitmovin Player SDK 2.14.0 Sep 7, 2018
gradle.properties Initial commit May 18, 2017
gradlew Initial commit May 18, 2017
gradlew.bat Initial commit May 18, 2017
settings.gradle Add BasicPlayerFragment sample Sep 5, 2018

README.md

bitmovin-player-android-samples

This repository contains sample apps using the Bitmovin Player Android SDK. The following sample apps are included:

  • BasicPlayback: Shows how the Bitmovin Player can be setup for basic playback of DASH, HLS or progressive streams.
  • BasicPlaylist: Shows how to implement queueing / playlists.
  • BasicDRMPlayback: Shows how the Bitmovin Player can be setup and configured for playback of Widevice Modular protected content.
  • BasicMetadataHandling Shows how the Bitmovin Player can be setup and configured for playback of content which contains metadata.
  • BasicAds Shows how the Bitmovin Player can be setup and configured for playback of ads.
  • BasicCasting Shows how the ChromeCast support of the Bitmovin Player can be setup and configured.
  • CustomUi Shows how the Bitmovin Player can be setup and configured to be controlled by a custom native UI.
  • CustomUiSubtitleView Shows how the Bitmovin Player can be used with the native BitmovinSubtitleView.
  • CustomHtmlUi Shows how the Bitmovin Player can be setup and configured to use a custom HTML UI.
  • BasicFullscreenHandling Shows how a simple FullscreenHandler can be implemented and configured on the Bitmovin Player
  • OfflinePlayback Shows how the Bitmovin Android SDK can be used to download protected and unprotected content for offline playback.
  • BasicVrPlayback Shows how the Bitmovin Player can be setup and configured for playback of VR content.
  • BasicPlayerFragment Shows how the BitmovinPlayerFragment can be used to setup playback.

Using The Sample Apps

In each sample app you have to add your Bitmovin Player license key inside the application tag in the manifest file as shown below. YOUR_LICENSE_KEY has to be replaced by your own license key.

<meta-data
            android:name="BITMOVIN_PLAYER_LICENSE_KEY"
            android:value="YOUR_LICENSE_KEY" />

In addition to that you have to log in to https://dashboard.bitmovin.com where you have to add the following package names of the sample applications as allowed domains under Player -> Licenses:

com.bitmovin.player.samples.playback.basic
com.bitmovin.player.samples.playlist.basic
com.bitmovin.player.samples.drm.basic
com.bitmovin.player.samples.metadata.basic
com.bitmovin.player.samples.ads.basic
com.bitmovin.player.samples.casting.basic
com.bitmovin.player.samples.vr.basic
com.bitmovin.player.samples.custom.ui
com.bitmovin.player.samples.custom.ui.subtitleview
com.bitmovin.player.samples.fullscreen.basic
com.bitmovin.player.samples.custom.ui.html
com.bitmovin.player.samples.offline.playback
com.bitmovin.player.samples.playerfragment.basic

Using The Bitmovin Player Android SDK

When you want to develop an own Android application using the Bitmovin Player Android SDK follow these steps:

  1. Add a link to our release repository to your applications build.gradle file. In addition to that, the google maven repository must be added.

    allprojects {
        repositories {
            jcenter()
            google()
            
            maven {
                url 'http://bitmovin.bintray.com/maven'
            }
        }
    }
    
  2. Add the Bitmovin Player Android SDK as a dependency to your project. It is recommended to reference a specific version as you can see below:

    implementation 'com.bitmovin.player:playercore:2.14.0'
    
  3. Additionally, if you want to use the Chromecast feature, add the following dependencies to your project:

    implementation 'com.google.android.gms:play-services-cast-framework:16.0.1'
    implementation 'com.android.support:mediarouter-v7:27.1.1'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'
    

    Furthermore, the BitmovinCastOptionsProvider and the ExpandedControllerActivity must be declared in the <application> tag of the AndroidManifest.xml. For more details see the BasicCasting sample application.

     <activity
             android:name="com.bitmovin.player.cast.ExpandedControllerActivity"
             android:launchMode="singleTask"
             android:screenOrientation="portrait"
             ... >
     </activity>
    
     <meta-data
             android:name="com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME"
             android:value="com.bitmovin.player.cast.BitmovinCastOptionsProvider"
             />
    
  4. If advertising support should be enabled, also add the following dependencies to your project:

     implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.8.7'
     implementation 'com.google.android.gms:play-services-ads:15.0.1'
     implementation 'com.android.support:support-v4:27.1.1'
    
  5. Make sure to add the INTERNET permission, which is required by the SDK, to the manifest file of your application

    <uses-permission android:name="android.permission.INTERNET" />
    
  6. If the Bitmovin Android SDK is used to download content for offline playback, also add the permission for checking the network state

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    
  7. In the manifest file of your application also provide your Bitmovin Player license key by adding a meta-data tag inside the application tag. YOUR_LICENSE_KEY has to be replaced by your own license key:

    <meta-data
            android:name="BITMOVIN_PLAYER_LICENSE_KEY"
            android:value="YOUR_LICENSE_KEY" />
    

    Your player license key can be found when logging in into https://dashboard.bitmovin.com and navigating to Player -> Licenses. There you also have to add the package name of the Android application which is using the SDK as a domain. The package name is defined in the manifest file of the Android application.

Proguard

When using Proguard, we recommend to do no further optimization nor code obfuscation for symbols contained in the package com.bitmovin.player. This can be achieved by adding following Progurad rules to your project.

#### Bitmovin
-keep class com.bitmovin.player.** { *; }
-keep interface com.bitmovin.player.** { *; }

Java Documentation

Our release repository also holds a .jar containing the javadoc for the playercore. If AndroidStudio is used, the documentation should be downloaded and included automatically .

Additional Resources

  • You can find the latest API documentation here
  • The release notes can be found here