use of com.unity3d.ads.UnityAdsShowOptions in project mopub-android-mediation by mopub.
the class UnityVideoAd method show.
@Override
public void show() {
MoPubLog.log(SHOW_ATTEMPTED, ADAPTER_NAME);
MediationMetaData mediationMetaData = new MediationMetaData(mActivity);
if (mActivity == null || mPlacementId == null) {
if (mActivity == null) {
MoPubLog.log(CUSTOM, ADAPTER_NAME, LOG_SHOW_ACTIVITY_NULL.getMessage());
}
if (!TextUtils.isEmpty(mPlacementId)) {
MoPubLog.log(CUSTOM, ADAPTER_NAME, LOG_PLACEMENT_ID_MISSING.getMessage());
}
MoPubLog.log(SHOW_FAILED, ADAPTER_NAME, MoPubErrorCode.VIDEO_PLAYBACK_ERROR.getIntCode(), MoPubErrorCode.VIDEO_PLAYBACK_ERROR);
mediationMetaData.setMissedImpressionOrdinal(++missedImpressionOrdinal);
mediationMetaData.commit();
UnityEventAdapter.sendAdPlaybackEvent(mInteractionListener, AdEvent.SHOW_FAILED, MoPubErrorCode.VIDEO_PLAYBACK_ERROR);
return;
}
mediationMetaData.setOrdinal(++impressionOrdinal);
mediationMetaData.commit();
final UnityAdsShowOptions showOptions = new UnityAdsShowOptions();
if (mObjectId != null) {
showOptions.setObjectId(mObjectId);
}
UnityAds.show(mActivity, mPlacementId, showOptions, getIUnityAdsShowListener());
}
Aggregations