In Android Studio, create a new project of type Empty Activity.
If your project is already created, you can skip this step.
Our player works with both Kotlin and Java. Yet, you will need to note which language you are using for later reference.
For the Android Minimum SDK, choose API 21. Earlier APIs can also be supported if needed. When done, click Finish to create the project.
Import the .AAR library in the project needed as following
Open the build.gradle file under the app folder and add the below dependencies
dependencies {
implementation files('../libs/HibridPlayer.aar')
implementation 'com.google.android.exoplayer:exoplayer:2.18.1'
implementation 'com.google.android.gms:play-services-analytics:18.0.2'
implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.28.2'
implementation 'com.google.android.exoplayer:extension-ima:2.18.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.0"
}
Change the entry HibridPlayer to whatever the file was named (from previous step)
Click on Sync Now to sync the project gradle
Add the below snippet within the projectactivity layout to include the HibridPlayer layout.
<app.hibrid.hibridplayer.view.HibridPlayerView
android:id="@+id/id"
android:layout_width="0dp"
android:layout_height="0dp"
app:autoPlay="true|false"
app:channelKey="<CHannelKeyName>"
app:lisence="<API-KEY>"
/>
Add the below snippet into the application manifest file inside the
android:configChanges="keyboardHidden|orientation|screenSize"
**If you are using an application:
In your application file, import HibridApplication
import app.hibrid.hibridplayer.Utils.HibridApplication
Set your class to extend HibridApplication
If you are not using an application: Open the app manifest and edit the application name attribute to the following:
android:name="app.hibrid.hibridplayer.Utils.HibridApplication"
Set your activity to extend HibridActivity instead of AppCompatActivity to get the player into your activity.
The HibridActivity will handle to pause/resume/destroy the player upon the activity life cycle plus will have listeners for the volume and orientation change.
Hibrid Player