当前位置: 首页>>代码示例>>Java>>正文


Java MediationRewardedVideoAdAdapter类代码示例

本文整理汇总了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;
}
 
开发者ID:googleads,项目名称:googleads-mobile-android-mediation,代码行数:9,代码来源:MaioEventForwarder.java

示例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);
}
 
开发者ID:myTargetSDK,项目名称:mytarget-android,代码行数:55,代码来源:MyTargetAdmobCustomEventRewarded.java

示例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);
}
 
开发者ID:googleads,项目名称:googleads-mobile-android-mediation,代码行数:6,代码来源:MaioEventForwarder.java


注:本文中的com.google.android.gms.ads.reward.mediation.MediationRewardedVideoAdAdapter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。