本文整理汇总了Java中com.google.android.gms.ads.reward.mediation.MediationRewardedVideoAdAdapter类的典型用法代码示例。如果您正苦于以下问题:Java MediationRewardedVideoAdAdapter类的具体用法?Java MediationRewardedVideoAdAdapter怎么用?Java MediationRewardedVideoAdAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MediationRewardedVideoAdAdapter类属于com.google.android.gms.ads.reward.mediation包,在下文中一共展示了MediationRewardedVideoAdAdapter类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: _showVideo
import com.google.android.gms.ads.reward.mediation.MediationRewardedVideoAdAdapter; //导入依赖的package包/类
private void _showVideo(String zoneId,
MediationRewardedVideoAdAdapter adapter,
MediationRewardedVideoAdListener listener) {
MaioAds.show(zoneId);
this.mRewardedAdapter = adapter;
this.mMediationRewardedVideoAdListener = listener;
mAdType = AdType.VIDEO;
}
示例2: initialize
import com.google.android.gms.ads.reward.mediation.MediationRewardedVideoAdAdapter; //导入依赖的package包/类
@Override
public void initialize(Context context,
MediationAdRequest mediationAdRequest,
String serverJSON,
MediationRewardedVideoAdListener mediationRewardedVideoAdListener,
Bundle serverParameters,
Bundle mediationExtras)
{
this.mediationRewardedVideoAdListener = mediationRewardedVideoAdListener;
int slotId;
try
{
String adUnit = serverParameters.getString(
MediationRewardedVideoAdAdapter.CUSTOM_EVENT_SERVER_PARAMETER_FIELD);
JSONObject param = new JSONObject(adUnit);
slotId = param.getInt(SLOT_ID_KEY);
} catch (JSONException e)
{
Log.i(TAG,
"Unable to get slotId from parameter json. Probably Admob mediation " +
"misconfiguration.");
mediationRewardedVideoAdListener.onAdFailedToLoad(
com.my.target.ads.mediation.MyTargetAdmobCustomEventRewarded.this,
AdRequest.ERROR_CODE_INTERNAL_ERROR);
return;
}
interstitial = new InterstitialAd(slotId, context);
interstitial.getCustomParams().setCustomParam("mediation", "1");
if (mediationAdRequest != null)
{
interstitial.getCustomParams().setGender(mediationAdRequest.getGender());
Date date = mediationAdRequest.getBirthday();
if (date != null && date.getTime() != -1)
{
GregorianCalendar calendar = new GregorianCalendar();
GregorianCalendar calendarNow = new GregorianCalendar();
calendar.setTimeInMillis(date.getTime());
int a = calendarNow.get(GregorianCalendar.YEAR) -
calendar.get(GregorianCalendar.YEAR);
if (a >= 0)
{
interstitial.getCustomParams().setAge(a);
}
}
}
interstitial.setListener(interstitialAdListener);
mediationRewardedVideoAdListener
.onInitializationSucceeded(com.my.target.ads.mediation.MyTargetAdmobCustomEventRewarded.this);
}
示例3: showVideo
import com.google.android.gms.ads.reward.mediation.MediationRewardedVideoAdAdapter; //导入依赖的package包/类
public static void showVideo(String zoneId,
MediationRewardedVideoAdAdapter adapter,
MediationRewardedVideoAdListener listener) {
sInstance._showVideo(zoneId, adapter, listener);
}