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

Java VideoProgressUpdate类代码示例

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

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



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

示例1: getContentProgress

import com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdate; //导入依赖的package包/类
@Override
public VideoProgressUpdate getContentProgress() {
  if (player == null) {
    return lastContentProgress;
  } else if (pendingContentPositionMs != C.TIME_UNSET) {
    sentPendingContentPositionMs = true;
    return new VideoProgressUpdate(pendingContentPositionMs, contentDurationMs);
  } else if (fakeContentProgressElapsedRealtimeMs != C.TIME_UNSET) {
    long elapsedSinceEndMs = SystemClock.elapsedRealtime() - fakeContentProgressElapsedRealtimeMs;
    long fakePositionMs = fakeContentProgressOffsetMs + elapsedSinceEndMs;
    return new VideoProgressUpdate(fakePositionMs, contentDurationMs);
  } else if (playingAd || contentDurationMs == C.TIME_UNSET) {
    return VideoProgressUpdate.VIDEO_TIME_NOT_READY;
  } else {
    return new VideoProgressUpdate(player.getCurrentPosition(), contentDurationMs);
  }
}
 
开发者ID:yangchaojiang,项目名称:yjPlay,代码行数:18,代码来源:ImaAdsLoader.java


示例2: requestAds

import com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdate; //导入依赖的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);
}
 
开发者ID:googleads,项目名称:googleads-ima-android,代码行数:27,代码来源:MyActivity.java


示例3: getAdProgress

import com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdate; //导入依赖的package包/类
@Override
public VideoProgressUpdate getAdProgress() {
  if (player == null) {
    return lastAdProgress;
  } else if (!playingAd) {
    return VideoProgressUpdate.VIDEO_TIME_NOT_READY;
  } else {
    long adDuration = player.getDuration();
    return adDuration == C.TIME_UNSET ? VideoProgressUpdate.VIDEO_TIME_NOT_READY
        : new VideoProgressUpdate(player.getCurrentPosition(), adDuration);
  }
}
 
开发者ID:yangchaojiang,项目名称:yjPlay,代码行数:13,代码来源:ImaAdsLoader.java


示例4: getAdProgress

import com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdate; //导入依赖的package包/类
@Override
public VideoProgressUpdate getAdProgress() {
  if (player == null) {
    return lastAdProgress;
  } else if (imaAdState == IMA_AD_STATE_NONE) {
    return VideoProgressUpdate.VIDEO_TIME_NOT_READY;
  } else {
    long adDuration = player.getDuration();
    return adDuration == C.TIME_UNSET ? VideoProgressUpdate.VIDEO_TIME_NOT_READY
        : new VideoProgressUpdate(player.getCurrentPosition(), adDuration);
  }
}
 
开发者ID:y20k,项目名称:transistor,代码行数:13,代码来源:ImaAdsLoader.java


示例5: getAdProgress

import com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdate; //导入依赖的package包/类
@Override
public VideoProgressUpdate getAdProgress() {
    if (mTvPlayer == null) {
        return VideoProgressUpdate.VIDEO_TIME_NOT_READY;
    }
    return new VideoProgressUpdate(
            mTvPlayer.getCurrentPosition(), mTvPlayer.getDuration());
}
 
开发者ID:googlesamples,项目名称:androidtv-sample-inputs,代码行数:9,代码来源:AdController.java


示例6: getContentProgress

import com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdate; //导入依赖的package包/类
@Override
public VideoProgressUpdate getContentProgress() {
  if (adPlayer != null || contentPlayer == null || contentPlayer.getDuration() <= 0) {
    return VideoProgressUpdate.VIDEO_TIME_NOT_READY;
  }
  return new VideoProgressUpdate(contentPlayer.getCurrentPosition(),
      contentPlayer.getDuration());
}
 
开发者ID:googleads,项目名称:google-media-framework-android,代码行数:9,代码来源:ImaPlayer.java


示例7: getAdProgress

import com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdate; //导入依赖的package包/类
@Override
public VideoProgressUpdate getAdProgress() {
    if (mAdPlayer == null || mAdPlayer.getDuration() <= 0) {
        return VideoProgressUpdate.VIDEO_TIME_NOT_READY;
    }
    return new VideoProgressUpdate(mAdPlayer.getCurrentPosition(), mAdPlayer.getDuration());
}
 
开发者ID:kaltura,项目名称:player-sdk-native-android,代码行数:8,代码来源:KIMAAdPlayer.java


示例8: getContentProgress

import com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdate; //导入依赖的package包/类
@Override
public VideoProgressUpdate getContentProgress() {
    if (player == null || player.getDuration() <= 0) {
        return VideoProgressUpdate.VIDEO_TIME_NOT_READY;
    }
    return new VideoProgressUpdate(player.getCurrentPlaybackTime(), player.getDuration());
}
 
开发者ID:kaltura,项目名称:player-sdk-native-android,代码行数:8,代码来源:KPlayerController.java


示例9: onProgressUpdated

import com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdate; //导入依赖的package包/类
void onProgressUpdated(VideoProgressUpdate progress); 
开发者ID:satorufujiwara,项目名称:exoplayer-ima,代码行数:2,代码来源:AdProgressUpdatedListener.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java NodeEngine类代码示例发布时间:2022-05-23
下一篇:
Java AbstractIntegerAssert类代码示例发布时间: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