本文整理汇总了Java中com.google.ads.interactivemedia.v3.api.player.ContentProgressProvider类的典型用法代码示例。如果您正苦于以下问题:Java ContentProgressProvider类的具体用法?Java ContentProgressProvider怎么用?Java ContentProgressProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ContentProgressProvider类属于com.google.ads.interactivemedia.v3.api.player包,在下文中一共展示了ContentProgressProvider类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: requestAds
import com.google.ads.interactivemedia.v3.api.player.ContentProgressProvider; //导入依赖的package包/类
/**
* Request video ads from the given VAST ad tag.
* @param adTagUrl URL of the ad's VAST XML
*/
private void requestAds(String adTagUrl) {
AdDisplayContainer adDisplayContainer = mSdkFactory.createAdDisplayContainer();
adDisplayContainer.setAdContainer(mAdUiContainer);
// Create the ads request.
AdsRequest request = mSdkFactory.createAdsRequest();
request.setAdTagUrl(adTagUrl);
request.setAdDisplayContainer(adDisplayContainer);
request.setContentProgressProvider(new ContentProgressProvider() {
@Override
public VideoProgressUpdate getContentProgress() {
if (mIsAdDisplayed || mVideoPlayer == null || mVideoPlayer.getDuration() <= 0) {
return VideoProgressUpdate.VIDEO_TIME_NOT_READY;
}
return new VideoProgressUpdate(mVideoPlayer.getCurrentPosition(),
mVideoPlayer.getDuration());
}
});
// Request the ad. After the ad is loaded, onAdsManagerLoaded() will be called.
mAdsLoader.requestAds(request);
}
示例2: requestAds
import com.google.ads.interactivemedia.v3.api.player.ContentProgressProvider; //导入依赖的package包/类
/**
* Request video ads from the given VAST ad tag.
* @param adTagUrl URL of the ad's VAST XML
*/
private void requestAds(String adTagUrl, ContentProgressProvider contentProgressProvider) {
LOGD(TAG, "Start requestAds adTagUrl = " + adTagUrl);
mAdDisplayContainer = mSdkFactory.createAdDisplayContainer();
mAdDisplayContainer.setPlayer(mIMAPlayer);
mAdDisplayContainer.setAdContainer(mIMAPlayer.getAdUIContainer());
// Create the ads request.
AdsRequest request = mSdkFactory.createAdsRequest();
request.setAdTagUrl(adTagUrl);
request.setAdDisplayContainer(mAdDisplayContainer);
request.setContentProgressProvider(contentProgressProvider);
// Request the ad. After the ad is loaded, onAdsManagerLoaded() will be called.
LOGD(TAG, "requestAds from IMA");
mAdsLoader.requestAds(request);
}
示例3: getContentProgressProvider
import com.google.ads.interactivemedia.v3.api.player.ContentProgressProvider; //导入依赖的package包/类
public ContentProgressProvider getContentProgressProvider() {
return mContentProgressProvider;
}