com.google.android.exoplayer2.analytics.AnalyticsCollector Java Examples

The following examples show how to use com.google.android.exoplayer2.analytics.AnalyticsCollector. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ExoPlayerFactory.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a {@link SimpleExoPlayer} instance.
 *
 * @param context A {@link Context}.
 * @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
 * @param trackSelector The {@link TrackSelector} that will be used by the instance.
 * @param loadControl The {@link LoadControl} that will be used by the instance.
 * @param drmSessionManager An optional {@link DrmSessionManager}. May be null if the instance
 *     will not be used for DRM protected playbacks.
 * @param analyticsCollectorFactory A factory for creating the {@link AnalyticsCollector} that
 *     will collect and forward all player events.
 * @param looper The {@link Looper} which must be used for all calls to the player and which is
 *     used to call listeners on.
 */
public static SimpleExoPlayer newSimpleInstance(
    Context context,
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    AnalyticsCollector.Factory analyticsCollectorFactory,
    Looper looper) {
  return newSimpleInstance(
      context,
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      getDefaultBandwidthMeter(context),
      analyticsCollectorFactory,
      looper);
}
 
Example #2
Source File: ExoPlayerFactory.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a {@link SimpleExoPlayer} instance.
 *
 * @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
 * @param trackSelector The {@link TrackSelector} that will be used by the instance.
 * @param loadControl The {@link LoadControl} that will be used by the instance.
 * @param drmSessionManager An optional {@link DrmSessionManager}. May be null if the instance
 *     will not be used for DRM protected playbacks.
 * @param bandwidthMeter The {@link BandwidthMeter} that will be used by the instance.
 */
public static SimpleExoPlayer newSimpleInstance(
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    BandwidthMeter bandwidthMeter) {
  return newSimpleInstance(
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      bandwidthMeter,
      new AnalyticsCollector.Factory(),
      Util.getLooper());
}
 
Example #3
Source File: ExoPlayerFactory.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a {@link SimpleExoPlayer} instance.
 *
 * @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
 * @param trackSelector The {@link TrackSelector} that will be used by the instance.
 * @param loadControl The {@link LoadControl} that will be used by the instance.
 * @param drmSessionManager An optional {@link DrmSessionManager}. May be null if the instance
 *     will not be used for DRM protected playbacks.
 * @param analyticsCollectorFactory A factory for creating the {@link AnalyticsCollector} that
 *     will collect and forward all player events.
 * @param looper The {@link Looper} which must be used for all calls to the player and which is
 *     used to call listeners on.
 */
public static SimpleExoPlayer newSimpleInstance(
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    AnalyticsCollector.Factory analyticsCollectorFactory,
    Looper looper) {
  return newSimpleInstance(
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      getDefaultBandwidthMeter(),
      analyticsCollectorFactory,
      looper);
}
 
Example #4
Source File: ExoPlayerFactory.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a {@link SimpleExoPlayer} instance.
 *
 * @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
 * @param trackSelector The {@link TrackSelector} that will be used by the instance.
 * @param loadControl The {@link LoadControl} that will be used by the instance.
 * @param drmSessionManager An optional {@link DrmSessionManager}. May be null if the instance
 *     will not be used for DRM protected playbacks.
 * @param analyticsCollectorFactory A factory for creating the {@link AnalyticsCollector} that
 *     will collect and forward all player events.
 * @param looper The {@link Looper} which must be used for all calls to the player and which is
 *     used to call listeners on.
 */
public static SimpleExoPlayer newSimpleInstance(
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    BandwidthMeter bandwidthMeter,
    AnalyticsCollector.Factory analyticsCollectorFactory,
    Looper looper) {
  return new SimpleExoPlayer(
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      bandwidthMeter,
      analyticsCollectorFactory,
      looper);
}
 
Example #5
Source File: SimpleExoPlayer.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
 * @param trackSelector The {@link TrackSelector} that will be used by the instance.
 * @param loadControl The {@link LoadControl} that will be used by the instance.
 * @param bandwidthMeter The {@link BandwidthMeter} that will be used by the instance.
 * @param drmSessionManager An optional {@link DrmSessionManager}. May be null if the instance
 *     will not be used for DRM protected playbacks.
 * @param looper The {@link Looper} which must be used for all calls to the player and which is
 *     used to call listeners on.
 */
protected SimpleExoPlayer(
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    BandwidthMeter bandwidthMeter,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    Looper looper) {
  this(
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      bandwidthMeter,
      new AnalyticsCollector.Factory(),
      looper);
}
 
Example #6
Source File: SimpleExoPlayer.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
 * @param trackSelector The {@link TrackSelector} that will be used by the instance.
 * @param loadControl The {@link LoadControl} that will be used by the instance.
 * @param drmSessionManager An optional {@link DrmSessionManager}. May be null if the instance
 *     will not be used for DRM protected playbacks.
 * @param bandwidthMeter The {@link BandwidthMeter} that will be used by the instance.
 * @param analyticsCollectorFactory A factory for creating the {@link AnalyticsCollector} that
 *     will collect and forward all player events.
 * @param looper The {@link Looper} which must be used for all calls to the player and which is
 *     used to call listeners on.
 */
protected SimpleExoPlayer(
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    BandwidthMeter bandwidthMeter,
    AnalyticsCollector.Factory analyticsCollectorFactory,
    Looper looper) {
  this(
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      bandwidthMeter,
      analyticsCollectorFactory,
      Clock.DEFAULT,
      looper);
}
 
Example #7
Source File: ExoMediaPlayer.java    From DKVideoPlayer with Apache License 2.0 6 votes vote down vote up
@Override
public void initPlayer() {
    mInternalPlayer = new SimpleExoPlayer.Builder(
            mAppContext,
            mRenderersFactory == null ? mRenderersFactory = new DefaultRenderersFactory(mAppContext) : mRenderersFactory,
            mTrackSelector == null ? mTrackSelector = new DefaultTrackSelector(mAppContext) : mTrackSelector,
            mLoadControl == null ? mLoadControl = new DefaultLoadControl() : mLoadControl,
            DefaultBandwidthMeter.getSingletonInstance(mAppContext),
            Util.getLooper(),
            new AnalyticsCollector(Clock.DEFAULT),
            /* useLazyPreparation= */ true,
            Clock.DEFAULT)
            .build();
    setOptions();

    //播放器日志
    if (VideoViewManager.getConfig().mIsEnableLog && mTrackSelector instanceof MappingTrackSelector) {
        mInternalPlayer.addAnalyticsListener(new EventLogger((MappingTrackSelector) mTrackSelector, "ExoPlayer"));
    }

    mInternalPlayer.addListener(this);
    mInternalPlayer.addVideoListener(this);
}
 
Example #8
Source File: ExoMediaPlayer.java    From ExoMedia with Apache License 2.0 6 votes vote down vote up
public ExoMediaPlayer(@NonNull Context context) {
    this.context = context;

    bufferRepeater.setRepeaterDelay(BUFFER_REPEAT_DELAY);
    bufferRepeater.setRepeatListener(new BufferRepeatListener());

    mainHandler = new Handler();

    ComponentListener componentListener = new ComponentListener();
    RendererProvider rendererProvider = new RendererProvider(context, mainHandler, componentListener, componentListener, componentListener, componentListener);
    DrmSessionManager<FrameworkMediaCrypto> drmSessionManager = generateDrmSessionManager();
    rendererProvider.setDrmSessionManager(drmSessionManager);

    renderers = rendererProvider.generate();

    adaptiveTrackSelectionFactory = new AdaptiveTrackSelection.Factory(bandwidthMeter);
    trackSelector = new DefaultTrackSelector(adaptiveTrackSelectionFactory);

    LoadControl loadControl = ExoMedia.Data.loadControl != null ? ExoMedia.Data.loadControl : new DefaultLoadControl();
    player = ExoPlayerFactory.newInstance(renderers.toArray(new Renderer[renderers.size()]), trackSelector, loadControl);
    player.addListener(this);
    analyticsCollector = new AnalyticsCollector.Factory().createAnalyticsCollector(player, Clock.DEFAULT);
    player.addListener(analyticsCollector);
    setupDamSessionManagerAnalytics(drmSessionManager);
}
 
Example #9
Source File: ExoPlayerFactory.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a {@link SimpleExoPlayer} instance.
 *
 * @param context A {@link Context}.
 * @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
 * @param trackSelector The {@link TrackSelector} that will be used by the instance.
 * @param loadControl The {@link LoadControl} that will be used by the instance.
 * @param drmSessionManager An optional {@link DrmSessionManager}. May be null if the instance
 *     will not be used for DRM protected playbacks.
 * @param bandwidthMeter The {@link BandwidthMeter} that will be used by the instance.
 */
public static SimpleExoPlayer newSimpleInstance(
    Context context,
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    BandwidthMeter bandwidthMeter) {
  return newSimpleInstance(
      context,
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      bandwidthMeter,
      new AnalyticsCollector.Factory(),
      Util.getLooper());
}
 
Example #10
Source File: ExoPlayerFactory.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a {@link SimpleExoPlayer} instance.
 *
 * @param context A {@link Context}.
 * @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
 * @param trackSelector The {@link TrackSelector} that will be used by the instance.
 * @param loadControl The {@link LoadControl} that will be used by the instance.
 * @param drmSessionManager An optional {@link DrmSessionManager}. May be null if the instance
 *     will not be used for DRM protected playbacks.
 * @param analyticsCollectorFactory A factory for creating the {@link AnalyticsCollector} that
 *     will collect and forward all player events.
 */
public static SimpleExoPlayer newSimpleInstance(
    Context context,
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    AnalyticsCollector.Factory analyticsCollectorFactory) {
  return newSimpleInstance(
      context,
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      analyticsCollectorFactory,
      Util.getLooper());
}
 
Example #11
Source File: ExoPlayerFactory.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a {@link SimpleExoPlayer} instance.
 *
 * @param context A {@link Context}.
 * @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
 * @param trackSelector The {@link TrackSelector} that will be used by the instance.
 * @param loadControl The {@link LoadControl} that will be used by the instance.
 * @param drmSessionManager An optional {@link DrmSessionManager}. May be null if the instance
 *     will not be used for DRM protected playbacks.
 * @param looper The {@link Looper} which must be used for all calls to the player and which is
 *     used to call listeners on.
 */
public static SimpleExoPlayer newSimpleInstance(
    Context context,
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    Looper looper) {
  return newSimpleInstance(
      context,
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      new AnalyticsCollector.Factory(),
      looper);
}
 
Example #12
Source File: ExoPlayerFactory.java    From MediaSDK with Apache License 2.0 6 votes vote down vote up
/**
 * @deprecated Use {@link SimpleExoPlayer.Builder} instead. The {@link DrmSessionManager} cannot
 *     be passed to {@link SimpleExoPlayer.Builder} and should instead be injected into the {@link
 *     MediaSource} factories.
 */
@Deprecated
@SuppressWarnings("deprecation")
public static SimpleExoPlayer newSimpleInstance(
    Context context,
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    AnalyticsCollector analyticsCollector) {
  return newSimpleInstance(
      context,
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      analyticsCollector,
      Util.getLooper());
}
 
Example #13
Source File: ExoPlayerFactory.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a {@link SimpleExoPlayer} instance.
 *
 * @param context A {@link Context}.
 * @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
 * @param trackSelector The {@link TrackSelector} that will be used by the instance.
 * @param loadControl The {@link LoadControl} that will be used by the instance.
 * @param drmSessionManager An optional {@link DrmSessionManager}. May be null if the instance
 *     will not be used for DRM protected playbacks.
 * @param analyticsCollectorFactory A factory for creating the {@link AnalyticsCollector} that
 *     will collect and forward all player events.
 * @param looper The {@link Looper} which must be used for all calls to the player and which is
 *     used to call listeners on.
 */
public static SimpleExoPlayer newSimpleInstance(
    Context context,
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    BandwidthMeter bandwidthMeter,
    AnalyticsCollector.Factory analyticsCollectorFactory,
    Looper looper) {
  return new SimpleExoPlayer(
      context,
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      bandwidthMeter,
      analyticsCollectorFactory,
      looper);
}
 
Example #14
Source File: SimpleExoPlayer.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param context A {@link Context}.
 * @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
 * @param trackSelector The {@link TrackSelector} that will be used by the instance.
 * @param loadControl The {@link LoadControl} that will be used by the instance.
 * @param bandwidthMeter The {@link BandwidthMeter} that will be used by the instance.
 * @param drmSessionManager An optional {@link DrmSessionManager}. May be null if the instance
 *     will not be used for DRM protected playbacks.
 * @param looper The {@link Looper} which must be used for all calls to the player and which is
 *     used to call listeners on.
 */
protected SimpleExoPlayer(
    Context context,
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    BandwidthMeter bandwidthMeter,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    Looper looper) {
  this(
      context,
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      bandwidthMeter,
      new AnalyticsCollector.Factory(),
      looper);
}
 
Example #15
Source File: SimpleExoPlayer.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param context A {@link Context}.
 * @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
 * @param trackSelector The {@link TrackSelector} that will be used by the instance.
 * @param loadControl The {@link LoadControl} that will be used by the instance.
 * @param drmSessionManager An optional {@link DrmSessionManager}. May be null if the instance
 *     will not be used for DRM protected playbacks.
 * @param bandwidthMeter The {@link BandwidthMeter} that will be used by the instance.
 * @param analyticsCollectorFactory A factory for creating the {@link AnalyticsCollector} that
 *     will collect and forward all player events.
 * @param looper The {@link Looper} which must be used for all calls to the player and which is
 *     used to call listeners on.
 */
protected SimpleExoPlayer(
    Context context,
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    BandwidthMeter bandwidthMeter,
    AnalyticsCollector.Factory analyticsCollectorFactory,
    Looper looper) {
  this(
      context,
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      bandwidthMeter,
      analyticsCollectorFactory,
      Clock.DEFAULT,
      looper);
}
 
Example #16
Source File: ExoPlayerFactory.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a {@link SimpleExoPlayer} instance.
 *
 * @param context A {@link Context}.
 * @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
 * @param trackSelector The {@link TrackSelector} that will be used by the instance.
 * @param loadControl The {@link LoadControl} that will be used by the instance.
 * @param drmSessionManager An optional {@link DrmSessionManager}. May be null if the instance
 *     will not be used for DRM protected playbacks.
 * @param bandwidthMeter The {@link BandwidthMeter} that will be used by the instance.
 */
public static SimpleExoPlayer newSimpleInstance(
    Context context,
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    BandwidthMeter bandwidthMeter) {
  return newSimpleInstance(
      context,
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      bandwidthMeter,
      new AnalyticsCollector.Factory(),
      Util.getLooper());
}
 
Example #17
Source File: ExoPlayerFactory.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a {@link SimpleExoPlayer} instance.
 *
 * @param context A {@link Context}.
 * @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
 * @param trackSelector The {@link TrackSelector} that will be used by the instance.
 * @param loadControl The {@link LoadControl} that will be used by the instance.
 * @param drmSessionManager An optional {@link DrmSessionManager}. May be null if the instance
 *     will not be used for DRM protected playbacks.
 * @param analyticsCollectorFactory A factory for creating the {@link AnalyticsCollector} that
 *     will collect and forward all player events.
 */
public static SimpleExoPlayer newSimpleInstance(
    Context context,
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    AnalyticsCollector.Factory analyticsCollectorFactory) {
  return newSimpleInstance(
      context,
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      analyticsCollectorFactory,
      Util.getLooper());
}
 
Example #18
Source File: ExoPlayerFactory.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a {@link SimpleExoPlayer} instance.
 *
 * @param context A {@link Context}.
 * @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
 * @param trackSelector The {@link TrackSelector} that will be used by the instance.
 * @param loadControl The {@link LoadControl} that will be used by the instance.
 * @param drmSessionManager An optional {@link DrmSessionManager}. May be null if the instance
 *     will not be used for DRM protected playbacks.
 * @param looper The {@link Looper} which must be used for all calls to the player and which is
 *     used to call listeners on.
 */
public static SimpleExoPlayer newSimpleInstance(
    Context context,
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    Looper looper) {
  return newSimpleInstance(
      context,
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      new AnalyticsCollector.Factory(),
      looper);
}
 
Example #19
Source File: ExoPlayerFactory.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a {@link SimpleExoPlayer} instance.
 *
 * @param context A {@link Context}.
 * @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
 * @param trackSelector The {@link TrackSelector} that will be used by the instance.
 * @param loadControl The {@link LoadControl} that will be used by the instance.
 * @param drmSessionManager An optional {@link DrmSessionManager}. May be null if the instance
 *     will not be used for DRM protected playbacks.
 * @param analyticsCollectorFactory A factory for creating the {@link AnalyticsCollector} that
 *     will collect and forward all player events.
 * @param looper The {@link Looper} which must be used for all calls to the player and which is
 *     used to call listeners on.
 */
public static SimpleExoPlayer newSimpleInstance(
    Context context,
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    AnalyticsCollector.Factory analyticsCollectorFactory,
    Looper looper) {
  return newSimpleInstance(
      context,
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      getDefaultBandwidthMeter(context),
      analyticsCollectorFactory,
      looper);
}
 
Example #20
Source File: ExoPlayerFactory.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a {@link SimpleExoPlayer} instance.
 *
 * @param context A {@link Context}.
 * @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
 * @param trackSelector The {@link TrackSelector} that will be used by the instance.
 * @param loadControl The {@link LoadControl} that will be used by the instance.
 * @param drmSessionManager An optional {@link DrmSessionManager}. May be null if the instance
 *     will not be used for DRM protected playbacks.
 * @param analyticsCollectorFactory A factory for creating the {@link AnalyticsCollector} that
 *     will collect and forward all player events.
 * @param looper The {@link Looper} which must be used for all calls to the player and which is
 *     used to call listeners on.
 */
public static SimpleExoPlayer newSimpleInstance(
    Context context,
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    BandwidthMeter bandwidthMeter,
    AnalyticsCollector.Factory analyticsCollectorFactory,
    Looper looper) {
  return new SimpleExoPlayer(
      context,
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      bandwidthMeter,
      analyticsCollectorFactory,
      looper);
}
 
Example #21
Source File: SimpleExoPlayer.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param context A {@link Context}.
 * @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
 * @param trackSelector The {@link TrackSelector} that will be used by the instance.
 * @param loadControl The {@link LoadControl} that will be used by the instance.
 * @param bandwidthMeter The {@link BandwidthMeter} that will be used by the instance.
 * @param drmSessionManager An optional {@link DrmSessionManager}. May be null if the instance
 *     will not be used for DRM protected playbacks.
 * @param looper The {@link Looper} which must be used for all calls to the player and which is
 *     used to call listeners on.
 */
protected SimpleExoPlayer(
    Context context,
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    BandwidthMeter bandwidthMeter,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    Looper looper) {
  this(
      context,
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      bandwidthMeter,
      new AnalyticsCollector.Factory(),
      looper);
}
 
Example #22
Source File: SimpleExoPlayer.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param context A {@link Context}.
 * @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
 * @param trackSelector The {@link TrackSelector} that will be used by the instance.
 * @param loadControl The {@link LoadControl} that will be used by the instance.
 * @param drmSessionManager An optional {@link DrmSessionManager}. May be null if the instance
 *     will not be used for DRM protected playbacks.
 * @param bandwidthMeter The {@link BandwidthMeter} that will be used by the instance.
 * @param analyticsCollectorFactory A factory for creating the {@link AnalyticsCollector} that
 *     will collect and forward all player events.
 * @param looper The {@link Looper} which must be used for all calls to the player and which is
 *     used to call listeners on.
 */
protected SimpleExoPlayer(
    Context context,
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    BandwidthMeter bandwidthMeter,
    AnalyticsCollector.Factory analyticsCollectorFactory,
    Looper looper) {
  this(
      context,
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      bandwidthMeter,
      analyticsCollectorFactory,
      Clock.DEFAULT,
      looper);
}
 
Example #23
Source File: SimpleExoPlayer.java    From MediaSDK with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a builder with the specified custom components.
 *
 * <p>Note that this constructor is only useful if you try to ensure that ExoPlayer's default
 * components can be removed by ProGuard or R8. For most components except renderers, there is
 * only a marginal benefit of doing that.
 *
 * @param context A {@link Context}.
 * @param renderersFactory A factory for creating {@link Renderer Renderers} to be used by the
 *     player.
 * @param trackSelector A {@link TrackSelector}.
 * @param loadControl A {@link LoadControl}.
 * @param bandwidthMeter A {@link BandwidthMeter}.
 * @param looper A {@link Looper} that must be used for all calls to the player.
 * @param analyticsCollector An {@link AnalyticsCollector}.
 * @param useLazyPreparation Whether media sources should be initialized lazily.
 * @param clock A {@link Clock}. Should always be {@link Clock#DEFAULT}.
 */
public Builder(
    Context context,
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    BandwidthMeter bandwidthMeter,
    Looper looper,
    AnalyticsCollector analyticsCollector,
    boolean useLazyPreparation,
    Clock clock) {
  this.context = context;
  this.renderersFactory = renderersFactory;
  this.trackSelector = trackSelector;
  this.loadControl = loadControl;
  this.bandwidthMeter = bandwidthMeter;
  this.looper = looper;
  this.analyticsCollector = analyticsCollector;
  this.useLazyPreparation = useLazyPreparation;
  this.clock = clock;
}
 
Example #24
Source File: ExoPlayerFactory.java    From MediaSDK with Apache License 2.0 6 votes vote down vote up
/**
 * @deprecated Use {@link SimpleExoPlayer.Builder} instead. The {@link DrmSessionManager} cannot
 *     be passed to {@link SimpleExoPlayer.Builder} and should instead be injected into the {@link
 *     MediaSource} factories.
 */
@SuppressWarnings("deprecation")
@Deprecated
public static SimpleExoPlayer newSimpleInstance(
    Context context,
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    BandwidthMeter bandwidthMeter,
    AnalyticsCollector analyticsCollector,
    Looper looper) {
  return new SimpleExoPlayer(
      context,
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      bandwidthMeter,
      analyticsCollector,
      Clock.DEFAULT,
      looper);
}
 
Example #25
Source File: SimpleExoPlayer.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
 * @param trackSelector The {@link TrackSelector} that will be used by the instance.
 * @param loadControl The {@link LoadControl} that will be used by the instance.
 * @param drmSessionManager An optional {@link DrmSessionManager}. May be null if the instance
 *     will not be used for DRM protected playbacks.
 * @param bandwidthMeter The {@link BandwidthMeter} that will be used by the instance.
 * @param analyticsCollectorFactory A factory for creating the {@link AnalyticsCollector} that
 *     will collect and forward all player events.
 * @param looper The {@link Looper} which must be used for all calls to the player and which is
 *     used to call listeners on.
 */
protected SimpleExoPlayer(
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    BandwidthMeter bandwidthMeter,
    AnalyticsCollector.Factory analyticsCollectorFactory,
    Looper looper) {
  this(
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      bandwidthMeter,
      analyticsCollectorFactory,
      Clock.DEFAULT,
      looper);
}
 
Example #26
Source File: SimpleExoPlayer.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
 * @param trackSelector The {@link TrackSelector} that will be used by the instance.
 * @param loadControl The {@link LoadControl} that will be used by the instance.
 * @param bandwidthMeter The {@link BandwidthMeter} that will be used by the instance.
 * @param drmSessionManager An optional {@link DrmSessionManager}. May be null if the instance
 *     will not be used for DRM protected playbacks.
 * @param looper The {@link Looper} which must be used for all calls to the player and which is
 *     used to call listeners on.
 */
protected SimpleExoPlayer(
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    BandwidthMeter bandwidthMeter,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    Looper looper) {
  this(
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      bandwidthMeter,
      new AnalyticsCollector.Factory(),
      looper);
}
 
Example #27
Source File: ExoPlayerFactory.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a {@link SimpleExoPlayer} instance.
 *
 * @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
 * @param trackSelector The {@link TrackSelector} that will be used by the instance.
 * @param loadControl The {@link LoadControl} that will be used by the instance.
 * @param drmSessionManager An optional {@link DrmSessionManager}. May be null if the instance
 *     will not be used for DRM protected playbacks.
 * @param analyticsCollectorFactory A factory for creating the {@link AnalyticsCollector} that
 *     will collect and forward all player events.
 * @param looper The {@link Looper} which must be used for all calls to the player and which is
 *     used to call listeners on.
 */
public static SimpleExoPlayer newSimpleInstance(
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    BandwidthMeter bandwidthMeter,
    AnalyticsCollector.Factory analyticsCollectorFactory,
    Looper looper) {
  return new SimpleExoPlayer(
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      bandwidthMeter,
      analyticsCollectorFactory,
      looper);
}
 
Example #28
Source File: ExoPlayerFactory.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a {@link SimpleExoPlayer} instance.
 *
 * @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
 * @param trackSelector The {@link TrackSelector} that will be used by the instance.
 * @param loadControl The {@link LoadControl} that will be used by the instance.
 * @param drmSessionManager An optional {@link DrmSessionManager}. May be null if the instance
 *     will not be used for DRM protected playbacks.
 * @param analyticsCollectorFactory A factory for creating the {@link AnalyticsCollector} that
 *     will collect and forward all player events.
 * @param looper The {@link Looper} which must be used for all calls to the player and which is
 *     used to call listeners on.
 */
public static SimpleExoPlayer newSimpleInstance(
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    AnalyticsCollector.Factory analyticsCollectorFactory,
    Looper looper) {
  return newSimpleInstance(
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      getDefaultBandwidthMeter(),
      analyticsCollectorFactory,
      looper);
}
 
Example #29
Source File: SimpleExoPlayer.java    From MediaSDK with Apache License 2.0 6 votes vote down vote up
/**
 * @param context A {@link Context}.
 * @param renderersFactory A factory for creating {@link Renderer}s to be used by the instance.
 * @param trackSelector The {@link TrackSelector} that will be used by the instance.
 * @param loadControl The {@link LoadControl} that will be used by the instance.
 * @param bandwidthMeter The {@link BandwidthMeter} that will be used by the instance.
 * @param analyticsCollector A factory for creating the {@link AnalyticsCollector} that will
 *     collect and forward all player events.
 * @param clock The {@link Clock} that will be used by the instance. Should always be {@link
 *     Clock#DEFAULT}, unless the player is being used from a test.
 * @param looper The {@link Looper} which must be used for all calls to the player and which is
 *     used to call listeners on.
 */
@SuppressWarnings("deprecation")
protected SimpleExoPlayer(
    Context context,
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    BandwidthMeter bandwidthMeter,
    AnalyticsCollector analyticsCollector,
    Clock clock,
    Looper looper) {
  this(
      context,
      renderersFactory,
      trackSelector,
      loadControl,
      DrmSessionManager.getDummyDrmSessionManager(),
      bandwidthMeter,
      analyticsCollector,
      clock,
      looper);
}
 
Example #30
Source File: ExoPlayerFactory.java    From MediaSDK with Apache License 2.0 6 votes vote down vote up
/**
 * @deprecated Use {@link SimpleExoPlayer.Builder} instead. The {@link DrmSessionManager} cannot
 *     be passed to {@link SimpleExoPlayer.Builder} and should instead be injected into the {@link
 *     MediaSource} factories.
 */
@Deprecated
@SuppressWarnings("deprecation")
public static SimpleExoPlayer newSimpleInstance(
    Context context,
    RenderersFactory renderersFactory,
    TrackSelector trackSelector,
    LoadControl loadControl,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    BandwidthMeter bandwidthMeter) {
  return newSimpleInstance(
      context,
      renderersFactory,
      trackSelector,
      loadControl,
      drmSessionManager,
      bandwidthMeter,
      new AnalyticsCollector(Clock.DEFAULT),
      Util.getLooper());
}