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


Java AdaptiveMediaSourceEventListener类代码示例

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


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

示例1: onLoadStarted

import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
@SuppressWarnings({"checkstyle:ParameterNumber", "PMD.ExcessiveParameterList"}) // This implements an interface method defined by ExoPlayer
@Override
public void onLoadStarted(DataSpec dataSpec,
                          int dataType,
                          int trackType,
                          Format trackFormat,
                          int trackSelectionReason,
                          Object trackSelectionData,
                          long mediaStartTimeMs,
                          long mediaEndTimeMs,
                          long elapsedRealtimeMs) {
    for (AdaptiveMediaSourceEventListener listener : listeners) {
        listener.onLoadStarted(
                dataSpec,
                dataType,
                trackType,
                trackFormat,
                trackSelectionReason,
                trackSelectionData,
                mediaStartTimeMs,
                mediaEndTimeMs,
                elapsedRealtimeMs
        );
    }
}
 
开发者ID:novoda,项目名称:no-player,代码行数:26,代码来源:MediaSourceEventListener.java

示例2: SsMediaSource

import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
private SsMediaSource(SsManifest manifest, Uri manifestUri,
    DataSource.Factory manifestDataSourceFactory, SsManifestParser manifestParser,
    SsChunkSource.Factory chunkSourceFactory, int minLoadableRetryCount,
    long livePresentationDelayMs, Handler eventHandler,
    AdaptiveMediaSourceEventListener eventListener) {
  Assertions.checkState(manifest == null || !manifest.isLive);
  this.manifest = manifest;
  this.manifestUri = manifestUri == null ? null
      : Util.toLowerInvariant(manifestUri.getLastPathSegment()).equals("manifest") ? manifestUri
          : Uri.withAppendedPath(manifestUri, "Manifest");
  this.manifestDataSourceFactory = manifestDataSourceFactory;
  this.manifestParser = manifestParser;
  this.chunkSourceFactory = chunkSourceFactory;
  this.minLoadableRetryCount = minLoadableRetryCount;
  this.livePresentationDelayMs = livePresentationDelayMs;
  this.eventDispatcher = new EventDispatcher(eventHandler, eventListener);
  mediaPeriods = new ArrayList<>();
}
 
开发者ID:jcodeing,项目名称:K-Sonic,代码行数:19,代码来源:SsMediaSource.java

示例3: HlsMediaSource

import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
public HlsMediaSource(Uri manifestUri, HlsDataSourceFactory dataSourceFactory,
    int minLoadableRetryCount, Handler eventHandler,
    AdaptiveMediaSourceEventListener eventListener) {
  this.manifestUri = manifestUri;
  this.dataSourceFactory = dataSourceFactory;
  this.minLoadableRetryCount = minLoadableRetryCount;
  eventDispatcher = new EventDispatcher(eventHandler, eventListener);
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:9,代码来源:HlsMediaSource.java

示例4: create

import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
public MediaSource create(ContentType contentType,
                          Uri uri,
                          ExtractorMediaSource.EventListener eventListener,
                          AdaptiveMediaSourceEventListener mediaSourceEventListener) {
    switch (contentType) {
        case HLS:
            return new HlsMediaSource(
                    uri,
                    mediaDataSourceFactory,
                    handler,
                    mediaSourceEventListener
            );
        case H264:
            DefaultExtractorsFactory extractorsFactory = new DefaultExtractorsFactory();
            return new ExtractorMediaSource(
                    uri,
                    mediaDataSourceFactory,
                    extractorsFactory,
                    handler,
                    eventListener
            );
        case DASH:
            DefaultDashChunkSource.Factory chunkSourceFactory = new DefaultDashChunkSource.Factory(mediaDataSourceFactory);
            return new DashMediaSource(
                    uri,
                    mediaDataSourceFactory,
                    chunkSourceFactory,
                    handler,
                    mediaSourceEventListener
            );
        default:
            throw new UnsupportedOperationException("Content type: " + contentType + " is not supported.");
    }
}
 
开发者ID:novoda,项目名称:no-player,代码行数:35,代码来源:MediaSourceFactory.java

示例5: onLoadCompleted

import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
@SuppressWarnings({"checkstyle:ParameterNumber", "PMD.ExcessiveParameterList"}) // This implements an interface method defined by ExoPlayer
@Override
public void onLoadCompleted(DataSpec dataSpec,
                            int dataType,
                            int trackType,
                            Format trackFormat,
                            int trackSelectionReason,
                            Object trackSelectionData,
                            long mediaStartTimeMs,
                            long mediaEndTimeMs,
                            long elapsedRealtimeMs,
                            long loadDurationMs,
                            long bytesLoaded) {
    for (AdaptiveMediaSourceEventListener listener : listeners) {
        listener.onLoadCompleted(
                dataSpec,
                dataType,
                trackType,
                trackFormat,
                trackSelectionReason,
                trackSelectionData,
                mediaStartTimeMs,
                mediaEndTimeMs,
                elapsedRealtimeMs,
                loadDurationMs,
                bytesLoaded
        );
    }
}
 
开发者ID:novoda,项目名称:no-player,代码行数:30,代码来源:MediaSourceEventListener.java

示例6: onLoadCanceled

import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
@SuppressWarnings({"checkstyle:ParameterNumber", "PMD.ExcessiveParameterList"}) // This implements an interface method defined by ExoPlayer
@Override
public void onLoadCanceled(DataSpec dataSpec,
                           int dataType,
                           int trackType,
                           Format trackFormat,
                           int trackSelectionReason,
                           Object trackSelectionData,
                           long mediaStartTimeMs,
                           long mediaEndTimeMs,
                           long elapsedRealtimeMs,
                           long loadDurationMs,
                           long bytesLoaded) {
    for (AdaptiveMediaSourceEventListener listener : listeners) {
        listener.onLoadCanceled(
                dataSpec,
                dataType,
                trackType,
                trackFormat,
                trackSelectionReason,
                trackSelectionData,
                mediaStartTimeMs,
                mediaEndTimeMs,
                elapsedRealtimeMs,
                loadDurationMs,
                bytesLoaded
        );
    }
}
 
开发者ID:novoda,项目名称:no-player,代码行数:30,代码来源:MediaSourceEventListener.java

示例7: onLoadError

import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
@SuppressWarnings({"checkstyle:ParameterNumber", "PMD.ExcessiveParameterList"}) // This implements an interface method defined by ExoPlayer
@Override
public void onLoadError(DataSpec dataSpec,
                        int dataType,
                        int trackType,
                        Format trackFormat,
                        int trackSelectionReason,
                        Object trackSelectionData,
                        long mediaStartTimeMs,
                        long mediaEndTimeMs,
                        long elapsedRealtimeMs,
                        long loadDurationMs,
                        long bytesLoaded,
                        IOException error,
                        boolean wasCanceled) {
    for (AdaptiveMediaSourceEventListener listener : listeners) {
        listener.onLoadError(
                dataSpec,
                dataType,
                trackType,
                trackFormat,
                trackSelectionReason,
                trackSelectionData,
                mediaStartTimeMs,
                mediaEndTimeMs,
                elapsedRealtimeMs,
                loadDurationMs,
                bytesLoaded,
                error,
                wasCanceled
        );
    }
}
 
开发者ID:novoda,项目名称:no-player,代码行数:34,代码来源:MediaSourceEventListener.java

示例8: onDownstreamFormatChanged

import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
@Override
public void onDownstreamFormatChanged(int trackType,
                                      Format trackFormat,
                                      int trackSelectionReason,
                                      Object trackSelectionData,
                                      long mediaTimeMs) {
    for (AdaptiveMediaSourceEventListener listener : listeners) {
        listener.onDownstreamFormatChanged(trackType, trackFormat, trackSelectionReason, trackSelectionData, mediaTimeMs);
    }
}
 
开发者ID:novoda,项目名称:no-player,代码行数:11,代码来源:MediaSourceEventListener.java

示例9: DashMediaSource

import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
private DashMediaSource(DashManifest manifest, Uri manifestUri,
    DataSource.Factory manifestDataSourceFactory, DashManifestParser manifestParser,
    DashChunkSource.Factory chunkSourceFactory, int minLoadableRetryCount,
    long livePresentationDelayMs, Handler eventHandler,
    AdaptiveMediaSourceEventListener eventListener) {
  this.manifest = manifest;
  this.manifestUri = manifestUri;
  this.manifestDataSourceFactory = manifestDataSourceFactory;
  this.manifestParser = manifestParser;
  this.chunkSourceFactory = chunkSourceFactory;
  this.minLoadableRetryCount = minLoadableRetryCount;
  this.livePresentationDelayMs = livePresentationDelayMs;
  sideloadedManifest = manifest != null;
  eventDispatcher = new EventDispatcher(eventHandler, eventListener);
  manifestUriLock = new Object();
  periodsById = new SparseArray<>();
  if (sideloadedManifest) {
    Assertions.checkState(!manifest.dynamic);
    manifestCallback = null;
    refreshManifestRunnable = null;
    simulateManifestRefreshRunnable = null;
  } else {
    manifestCallback = new ManifestCallback();
    refreshManifestRunnable = new Runnable() {
      @Override
      public void run() {
        startLoadingManifest();
      }
    };
    simulateManifestRefreshRunnable = new Runnable() {
      @Override
      public void run() {
        processManifest(false);
      }
    };
  }
}
 
开发者ID:jcodeing,项目名称:K-Sonic,代码行数:38,代码来源:DashMediaSource.java

示例10: HlsMediaSource

import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
public HlsMediaSource(Uri manifestUri, DataSource.Factory dataSourceFactory,
    int minLoadableRetryCount, Handler eventHandler,
    AdaptiveMediaSourceEventListener eventListener) {
  this.manifestUri = manifestUri;
  this.dataSourceFactory = dataSourceFactory;
  this.minLoadableRetryCount = minLoadableRetryCount;
  eventDispatcher = new EventDispatcher(eventHandler, eventListener);
}
 
开发者ID:zhanglibin123488,项目名称:videoPickPlayer,代码行数:9,代码来源:HlsMediaSource.java

示例11: DashMediaSource

import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
public DashMediaSource(Uri manifestUri, DataSource.Factory manifestDataSourceFactory,
    DashChunkSource.Factory chunkSourceFactory, Handler eventHandler,
    AdaptiveMediaSourceEventListener eventListener) {
  this(manifestUri, manifestDataSourceFactory, chunkSourceFactory,
      DEFAULT_MIN_LOADABLE_RETRY_COUNT, DEFAULT_LIVE_PRESENTATION_DELAY_PREFER_MANIFEST_MS,
      eventHandler, eventListener);
}
 
开发者ID:zhanglibin123488,项目名称:videoPickPlayer,代码行数:8,代码来源:DashMediaSource.java

示例12: SsMediaSource

import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
public SsMediaSource(Uri manifestUri, DataSource.Factory manifestDataSourceFactory,
    SsChunkSource.Factory chunkSourceFactory, Handler eventHandler,
    AdaptiveMediaSourceEventListener eventListener) {
  this(manifestUri, manifestDataSourceFactory, chunkSourceFactory,
      DEFAULT_MIN_LOADABLE_RETRY_COUNT, DEFAULT_LIVE_PRESENTATION_DELAY_MS, eventHandler,
      eventListener);
}
 
开发者ID:zhanglibin123488,项目名称:videoPickPlayer,代码行数:8,代码来源:SsMediaSource.java

示例13: add

import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
public void add(AdaptiveMediaSourceEventListener listener) {
    listeners.add(listener);
}
 
开发者ID:novoda,项目名称:no-player,代码行数:4,代码来源:MediaSourceEventListener.java

示例14: onUpstreamDiscarded

import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
@Override
public void onUpstreamDiscarded(int trackType, long mediaStartTimeMs, long mediaEndTimeMs) {
    for (AdaptiveMediaSourceEventListener listener : listeners) {
        listener.onUpstreamDiscarded(trackType, mediaStartTimeMs, mediaEndTimeMs);
    }
}
 
开发者ID:novoda,项目名称:no-player,代码行数:7,代码来源:MediaSourceEventListener.java

示例15: mediaSourceEventListener

import com.google.android.exoplayer2.source.AdaptiveMediaSourceEventListener; //导入依赖的package包/类
public AdaptiveMediaSourceEventListener mediaSourceEventListener() {
    return mediaSourceEventListener;
}
 
开发者ID:novoda,项目名称:no-player,代码行数:4,代码来源:ExoPlayerForwarder.java


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