• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AdErrorEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.ads.interactivemedia.v3.api.AdErrorEvent的典型用法代码示例。如果您正苦于以下问题:Java AdErrorEvent类的具体用法?Java AdErrorEvent怎么用?Java AdErrorEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AdErrorEvent类属于com.google.ads.interactivemedia.v3.api包,在下文中一共展示了AdErrorEvent类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onAdError

import com.google.ads.interactivemedia.v3.api.AdErrorEvent; //导入依赖的package包/类
@Override
public void onAdError(AdErrorEvent adErrorEvent) {
  if (DEBUG) {
    Log.d(TAG, "onAdError " + adErrorEvent);
  }
  if (adsManager == null) {
    // No ads were loaded, so allow playback to start without any ads.
    pendingAdRequestContext = null;
    adPlaybackState = new AdPlaybackState(new long[0]);
    updateAdPlaybackState();
  }
  if (pendingAdErrorEvent == null) {
    pendingAdErrorEvent = adErrorEvent;
  }
  maybeNotifyAdError();
}
 
开发者ID:y20k,项目名称:transistor,代码行数:17,代码来源:ImaAdsLoader.java


示例2: onAdError

import com.google.ads.interactivemedia.v3.api.AdErrorEvent; //导入依赖的package包/类
@Override
public void onAdError(AdErrorEvent adErrorEvent) {
  if (DEBUG) {
    Log.d(TAG, "onAdError " + adErrorEvent);
  }
  if (adsManager == null) {
    adPlaybackState = new AdPlaybackState(new long[0]);
    updateAdPlaybackState();
  }
  if (eventListener != null) {
    IOException exception = new IOException("Ad error: " + adErrorEvent, adErrorEvent.getError());
    eventListener.onLoadError(exception);
  }
}
 
开发者ID:yangchaojiang,项目名称:yjPlay,代码行数:15,代码来源:ImaAdsLoader.java


示例3: addAdErrorListener

import com.google.ads.interactivemedia.v3.api.AdErrorEvent; //导入依赖的package包/类
public void addAdErrorListener(final AdErrorEvent.AdErrorListener l) {
    adErrorListeners.add(l);
    adsLoader.addAdErrorListener(l);
    if (adsManager != null) {
        adsManager.addAdErrorListener(l);
    }
}
 
开发者ID:satorufujiwara,项目名称:exoplayer-ima,代码行数:8,代码来源:AdPlayerController.java


示例4: removeAdErrorListener

import com.google.ads.interactivemedia.v3.api.AdErrorEvent; //导入依赖的package包/类
public void removeAdErrorListener(final AdErrorEvent.AdErrorListener l) {
    adErrorListeners.remove(l);
    adsLoader.removeAdErrorListener(l);
    if (adsManager != null) {
        adsManager.removeAdErrorListener(l);
    }
}
 
开发者ID:satorufujiwara,项目名称:exoplayer-ima,代码行数:8,代码来源:AdPlayerController.java


示例5: onAdError

import com.google.ads.interactivemedia.v3.api.AdErrorEvent; //导入依赖的package包/类
@Override
public void onAdError(AdErrorEvent adErrorEvent) {
  // If there is an error in ad playback, log the error and resume the content.
  Log.d(this.getClass().getSimpleName(), adErrorEvent.getError().getMessage());

  // Display a toast message indicating the error.
  // You should remove this line of code for your production app.
  Toast.makeText(activity, adErrorEvent.getError().getMessage(), Toast.LENGTH_SHORT).show();
  resumeContent();
}
 
开发者ID:googleads,项目名称:google-media-framework-android,代码行数:11,代码来源:ImaPlayer.java


示例6: onAdError

import com.google.ads.interactivemedia.v3.api.AdErrorEvent; //导入依赖的package包/类
/**
 * An event raised when there is an error loading or playing ads.
 */
@Override
public void onAdError(AdErrorEvent adErrorEvent) {
    LOGD(TAG, "Start onAdError");

    String errMsg = "UNKNOWN ERROR";
    if (adErrorEvent != null) {
        errMsg = "Ad Error: " + adErrorEvent.getError().getErrorCode().name() + " - " + adErrorEvent.getError().getMessage();
    }
    LOGE(TAG, "IMA onAdError " + errMsg);
    if (mListener != null) {
        mListener.onAdError(errMsg);
    }
}
 
开发者ID:kaltura,项目名称:player-sdk-native-android,代码行数:17,代码来源:KIMAManager.java


示例7: onAdError

import com.google.ads.interactivemedia.v3.api.AdErrorEvent; //导入依赖的package包/类
@Override
public void onAdError(AdErrorEvent adErrorEvent) {
    Log.e(TAG, adErrorEvent.getError().getMessage());
    mAdControllerCallback.onAdError();
    release();
}
 
开发者ID:googlesamples,项目名称:androidtv-sample-inputs,代码行数:7,代码来源:AdController.java


示例8: onAdsManagerLoaded

import com.google.ads.interactivemedia.v3.api.AdErrorEvent; //导入依赖的package包/类
/**
 * An event raised when ads are successfully loaded from the ad server via AdsLoader.
 */
@Override
public void onAdsManagerLoaded(AdsManagerLoadedEvent adsManagerLoadedEvent) {
    // Ads were successfully loaded, so get the AdsManager instance. AdsManager has
    // events for ad playback and errors.
    mAdsManager = adsManagerLoadedEvent.getAdsManager();

    // Attach event and error event listeners.
    mAdsManager.addAdErrorListener(new AdErrorEvent.AdErrorListener() {
        /**
         * An event raised when there is an error loading or playing ads.
         */
        @Override
        public void onAdError(AdErrorEvent adErrorEvent) {
            log("Ad Error: " + adErrorEvent.getError().getMessage());
            resumeContent();
        }
    });
    mAdsManager.addAdEventListener(new AdEvent.AdEventListener() {
        /**
         * Responds to AdEvents.
         */
        @Override
        public void onAdEvent(AdEvent adEvent) {
            log("Event: " + adEvent.getType());

            // These are the suggested event types to handle. For full list of all ad
            // event types, see the documentation for AdEvent.AdEventType.
            switch (adEvent.getType()) {
                case LOADED:
                    // AdEventType.LOADED will be fired when ads are ready to be
                    // played. AdsManager.start() begins ad playback. This method is
                    // ignored for VMAP or ad rules playlists, as the SDK will
                    // automatically start executing the playlist.
                    mAdsManager.start();
                    break;
                case CONTENT_PAUSE_REQUESTED:
                    // AdEventType.CONTENT_PAUSE_REQUESTED is fired immediately before
                    // a video ad is played.
                    pauseContent();
                    break;
                case CONTENT_RESUME_REQUESTED:
                    // AdEventType.CONTENT_RESUME_REQUESTED is fired when the ad is
                    // completed and you should start playing your content.
                    resumeContent();
                    break;
                case PAUSED:
                    mIsAdPlaying = false;
                    break;
                case RESUMED:
                    mIsAdPlaying = true;
                    break;
                case ALL_ADS_COMPLETED:
                    if (mAdsManager != null) {
                        mAdsManager.destroy();
                        mAdsManager = null;
                    }
                    break;
                default:
                    break;
            }
        }
    });
    mAdsManager.init();
}
 
开发者ID:googleads,项目名称:googleads-ima-android,代码行数:68,代码来源:VideoPlayerController.java


示例9: VideoPlayerController

import com.google.ads.interactivemedia.v3.api.AdErrorEvent; //导入依赖的package包/类
public VideoPlayerController(Context context,
        VideoPlayerWithAdPlayback videoPlayerWithAdPlayback, View playButton,
        View playPauseToggle, String language, ViewGroup companionViewGroup, Logger log) {
    mVideoPlayerWithAdPlayback = videoPlayerWithAdPlayback;
    mPlayButton = playButton;
    mPlayPauseToggle = playPauseToggle;
    mIsAdPlaying = false;
    mCompanionViewGroup = companionViewGroup;
    mLog = log;

    // Create an AdsLoader and optionally set the language.
    ImaSdkSettings imaSdkSettings = new ImaSdkSettings();
    imaSdkSettings.setLanguage(language);
    mSdkFactory = ImaSdkFactory.getInstance();
    mAdsLoader = mSdkFactory.createAdsLoader(context, imaSdkSettings);

    mAdsLoader.addAdErrorListener(new AdErrorEvent.AdErrorListener() {
        /**
         * An event raised when there is an error loading or playing ads.
         */
        @Override
        public void onAdError(AdErrorEvent adErrorEvent) {
            log("Ad Error: " + adErrorEvent.getError().getMessage());
            resumeContent();
        }
    });

    mAdsLoader.addAdsLoadedListener(new VideoPlayerController.AdsLoadedListener());

    mVideoPlayerWithAdPlayback.setOnContentCompleteListener(
            new VideoPlayerWithAdPlayback.OnContentCompleteListener() {
                /**
                 * Event raised by VideoPlayerWithAdPlayback when content video is complete.
                 */
                @Override
                public void onContentComplete() {
                    mAdsLoader.contentComplete();
                }
            });

    // When Play is clicked, request ads and hide the button.
    mPlayButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            requestAndPlayAds();
        }
    });
}
 
开发者ID:googleads,项目名称:googleads-ima-android,代码行数:49,代码来源:VideoPlayerController.java


示例10: onAdError

import com.google.ads.interactivemedia.v3.api.AdErrorEvent; //导入依赖的package包/类
@Override
public void onAdError(AdErrorEvent adErrorEvent) {
    Log.e(LOGTAG, "Ad Error: " + adErrorEvent.getError().getMessage());
    mVideoPlayer.play();
}
 
开发者ID:googleads,项目名称:googleads-ima-android,代码行数:6,代码来源:MyActivity.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FacesContextEx类代码示例发布时间:2022-05-23
下一篇:
Java TracerMode类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap