Skip to content

Ad Integration

Yu-Hsuan Lin edited this page Sep 18, 2016 · 4 revisions

If you want to integration with Interactive Media Ads, first include our extension for IMA in build.gradle:

compile 'io.straas.android.sdk:extension-ima:+'

All you have to do is to write this line in java code:

mStraasMediaCore.setImaHelper(ImaHelper.newInstance());

Then everything is done.

If you build your own player UI, the playback state of Ad is important (you may want to show different UI between normal content). When rolling with Ad, the getActiveQueueItemId() will be StraasMediaCore.AD_PLAYBACK_ID. StraasPlayerView in our sample code handle all playback states correctly.