This application inserts advertisements using the IMAWrapper class via the Google Interactive Media Ads (IMA) SDK to access ad servers that support VAST and VMAP. For more information, see:
Advert server already configured and knowledge of the ad tag URLs that will be used to access it.
Example code
The Java source code contains the IMAWrapper package which simplifies configuration and access to an ad-server, as well as playback and display of the adverts. The following instructions show you how to modify your existing application to make use of the IMAWrapper package with the Google IMA libraries; the main stages are as follows:
Project setup
Enable playback of linear adverts (video sections interrupting playback)
Enable playback of companion adverts (views accompanying the main video)
Project setup
In the application project you are building, update your Gradle script to fetch the Google IMA Play Services libraries from the Google Maven repository.