Add an ad client dependency
Enable Google IMA and Google DAI ad requests in your app
IMPORTANT
If you are not using Google IMA or Google DAI to serve your ads, skip to Schedule VAST ads.
The JW Player SDK for Android integrates the Google IMA and Google DAI SDKs that you can use to request ads.
Requirements
Ad Client | Requirements |
---|---|
Google DAI | - All the JW Player Android SDK requirements - Google's Ad Manager 360 Advanced |
Google IMA | - All the JW Player Android SDK requirements |
Add client dependency
Gradle
- In the build.gradle file of your app, add com.jwplayer:jwplayer-ima:x.x.x. Be sure to replace
x.x.x
with the dependency version number.
dependencies {
...
implementation 'com.jwplayer:jwplayer-core:x.x.x'
implementation 'com.jwplayer:jwplayer-common:x.x.x'
implementation 'com.jwplayer:jwplayer-ima:x.x.x'
implementation 'com.google.ads.interactivemedia.v3:interactivemedia:${GOOGLE_IMA_VERSION}'
implementation 'com.google.android.gms:play-services-ads-identifier
:${GOOGLE_IMA_VERSION}'
}
- Sync Gradle.
Local
- With your app open in Android Studio, click File > New > New Module... > Import .JAR / .AAR Package.
- Click Next.
- Select the jwplayer-ima-x.x.aar file from your computer.
If you do not have a jwplayer-ima-x.x.x.aar file on your computer, you can download the Android SDK .zip from your JW Player dashboard.
- Click Finish.
- Click File > Project Structure... > Dependencies. Under Modules, be sure that your app is selected.
- Click the plus sign in the main panel.
- Select Module dependency.
- Select the checkbox next to the name of each dependency that needs to be added.
- Click OK.
- Click Apply.
- Click OK.
Updated 11 months ago
Did this page help you?