com.google.android.exoplayer2.source.DefaultCompositeSequenceableLoaderFactory Java Examples

The following examples show how to use com.google.android.exoplayer2.source.DefaultCompositeSequenceableLoaderFactory. 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: DashMediaSource.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs an instance to play a given {@link DashManifest}, which must be static.
 *
 * @param manifest The manifest. {@link DashManifest#dynamic} must be false.
 * @param chunkSourceFactory A factory for {@link DashChunkSource} instances.
 * @param minLoadableRetryCount The minimum number of times to retry if a loading error occurs.
 * @param eventHandler A handler for events. May be null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @deprecated Use {@link Factory} instead.
 */
@Deprecated
public DashMediaSource(
    DashManifest manifest,
    DashChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount,
    Handler eventHandler,
    MediaSourceEventListener eventListener) {
  this(
      manifest,
      /* manifestUri= */ null,
      /* manifestDataSourceFactory= */ null,
      /* manifestParser= */ null,
      chunkSourceFactory,
      new DefaultCompositeSequenceableLoaderFactory(),
      minLoadableRetryCount,
      DEFAULT_LIVE_PRESENTATION_DELAY_MS,
      /* livePresentationDelayOverridesManifest= */ false,
      /* tag= */ null);
  if (eventHandler != null && eventListener != null) {
    addEventListener(eventHandler, eventListener);
  }
}
 
Example #2
Source File: SsMediaSource.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs an instance to play the manifest at a given {@link Uri}, which may be live or
 * on-demand.
 *
 * @param manifestUri The manifest {@link Uri}.
 * @param manifestDataSourceFactory A factory for {@link DataSource} instances that will be used
 *     to load (and refresh) the manifest.
 * @param manifestParser A parser for loaded manifest data.
 * @param chunkSourceFactory A factory for {@link SsChunkSource} instances.
 * @param minLoadableRetryCount The minimum number of times to retry if a loading error occurs.
 * @param livePresentationDelayMs For live playbacks, the duration in milliseconds by which the
 *     default start position should precede the end of the live window.
 * @param eventHandler A handler for events. May be null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @deprecated Use {@link Factory} instead.
 */
@Deprecated
public SsMediaSource(
    Uri manifestUri,
    DataSource.Factory manifestDataSourceFactory,
    ParsingLoadable.Parser<? extends SsManifest> manifestParser,
    SsChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount,
    long livePresentationDelayMs,
    Handler eventHandler,
    MediaSourceEventListener eventListener) {
  this(
      /* manifest= */ null,
      manifestUri,
      manifestDataSourceFactory,
      manifestParser,
      chunkSourceFactory,
      new DefaultCompositeSequenceableLoaderFactory(),
      new DefaultLoadErrorHandlingPolicy(minLoadableRetryCount),
      livePresentationDelayMs,
      /* tag= */ null);
  if (eventHandler != null && eventListener != null) {
    addEventListener(eventHandler, eventListener);
  }
}
 
Example #3
Source File: SsMediaSource.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs an instance to play a given {@link SsManifest}, which must not be live.
 *
 * @param manifest The manifest. {@link SsManifest#isLive} must be false.
 * @param chunkSourceFactory A factory for {@link SsChunkSource} instances.
 * @param minLoadableRetryCount The minimum number of times to retry if a loading error occurs.
 * @param eventHandler A handler for events. May be null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @deprecated Use {@link Factory} instead.
 */
@Deprecated
public SsMediaSource(
    SsManifest manifest,
    SsChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount,
    Handler eventHandler,
    MediaSourceEventListener eventListener) {
  this(
      manifest,
      /* manifestUri= */ null,
      /* manifestDataSourceFactory= */ null,
      /* manifestParser= */ null,
      chunkSourceFactory,
      new DefaultCompositeSequenceableLoaderFactory(),
      new DefaultLoadErrorHandlingPolicy(minLoadableRetryCount),
      DEFAULT_LIVE_PRESENTATION_DELAY_MS,
      /* tag= */ null);
  if (eventHandler != null && eventListener != null) {
    addEventListener(eventHandler, eventListener);
  }
}
 
Example #4
Source File: DashMediaSource.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs an instance to play a given {@link DashManifest}, which must be static.
 *
 * @param manifest The manifest. {@link DashManifest#dynamic} must be false.
 * @param chunkSourceFactory A factory for {@link DashChunkSource} instances.
 * @param minLoadableRetryCount The minimum number of times to retry if a loading error occurs.
 * @param eventHandler A handler for events. May be null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @deprecated Use {@link Factory} instead.
 */
@Deprecated
public DashMediaSource(
    DashManifest manifest,
    DashChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount,
    Handler eventHandler,
    MediaSourceEventListener eventListener) {
  this(
      manifest,
      /* manifestUri= */ null,
      /* manifestDataSourceFactory= */ null,
      /* manifestParser= */ null,
      chunkSourceFactory,
      new DefaultCompositeSequenceableLoaderFactory(),
      new DefaultLoadErrorHandlingPolicy(minLoadableRetryCount),
      DEFAULT_LIVE_PRESENTATION_DELAY_MS,
      /* livePresentationDelayOverridesManifest= */ false,
      /* tag= */ null);
  if (eventHandler != null && eventListener != null) {
    addEventListener(eventHandler, eventListener);
  }
}
 
Example #5
Source File: SsMediaSource.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs an instance to play the manifest at a given {@link Uri}, which may be live or
 * on-demand.
 *
 * @param manifestUri The manifest {@link Uri}.
 * @param manifestDataSourceFactory A factory for {@link DataSource} instances that will be used
 *     to load (and refresh) the manifest.
 * @param manifestParser A parser for loaded manifest data.
 * @param chunkSourceFactory A factory for {@link SsChunkSource} instances.
 * @param minLoadableRetryCount The minimum number of times to retry if a loading error occurs.
 * @param livePresentationDelayMs For live playbacks, the duration in milliseconds by which the
 *     default start position should precede the end of the live window.
 * @param eventHandler A handler for events. May be null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @deprecated Use {@link Factory} instead.
 */
@Deprecated
public SsMediaSource(
    Uri manifestUri,
    DataSource.Factory manifestDataSourceFactory,
    ParsingLoadable.Parser<? extends SsManifest> manifestParser,
    SsChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount,
    long livePresentationDelayMs,
    Handler eventHandler,
    MediaSourceEventListener eventListener) {
  this(
      /* manifest= */ null,
      manifestUri,
      manifestDataSourceFactory,
      manifestParser,
      chunkSourceFactory,
      new DefaultCompositeSequenceableLoaderFactory(),
      new DefaultLoadErrorHandlingPolicy(minLoadableRetryCount),
      livePresentationDelayMs,
      /* tag= */ null);
  if (eventHandler != null && eventListener != null) {
    addEventListener(eventHandler, eventListener);
  }
}
 
Example #6
Source File: SsMediaSource.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs an instance to play a given {@link SsManifest}, which must not be live.
 *
 * @param manifest The manifest. {@link SsManifest#isLive} must be false.
 * @param chunkSourceFactory A factory for {@link SsChunkSource} instances.
 * @param minLoadableRetryCount The minimum number of times to retry if a loading error occurs.
 * @param eventHandler A handler for events. May be null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @deprecated Use {@link Factory} instead.
 */
@Deprecated
public SsMediaSource(
    SsManifest manifest,
    SsChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount,
    Handler eventHandler,
    MediaSourceEventListener eventListener) {
  this(
      manifest,
      /* manifestUri= */ null,
      /* manifestDataSourceFactory= */ null,
      /* manifestParser= */ null,
      chunkSourceFactory,
      new DefaultCompositeSequenceableLoaderFactory(),
      new DefaultLoadErrorHandlingPolicy(minLoadableRetryCount),
      DEFAULT_LIVE_PRESENTATION_DELAY_MS,
      /* tag= */ null);
  if (eventHandler != null && eventListener != null) {
    addEventListener(eventHandler, eventListener);
  }
}
 
Example #7
Source File: DashMediaSource.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs an instance to play a given {@link DashManifest}, which must be static.
 *
 * @param manifest The manifest. {@link DashManifest#dynamic} must be false.
 * @param chunkSourceFactory A factory for {@link DashChunkSource} instances.
 * @param minLoadableRetryCount The minimum number of times to retry if a loading error occurs.
 * @param eventHandler A handler for events. May be null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @deprecated Use {@link Factory} instead.
 */
@Deprecated
public DashMediaSource(
    DashManifest manifest,
    DashChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount,
    Handler eventHandler,
    MediaSourceEventListener eventListener) {
  this(
      manifest,
      /* manifestUri= */ null,
      /* manifestDataSourceFactory= */ null,
      /* manifestParser= */ null,
      chunkSourceFactory,
      new DefaultCompositeSequenceableLoaderFactory(),
      new DefaultLoadErrorHandlingPolicy(minLoadableRetryCount),
      DEFAULT_LIVE_PRESENTATION_DELAY_MS,
      /* livePresentationDelayOverridesManifest= */ false,
      /* tag= */ null);
  if (eventHandler != null && eventListener != null) {
    addEventListener(eventHandler, eventListener);
  }
}
 
Example #8
Source File: SsMediaSource.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs an instance to play the manifest at a given {@link Uri}, which may be live or
 * on-demand.
 *
 * @param manifestUri The manifest {@link Uri}.
 * @param manifestDataSourceFactory A factory for {@link DataSource} instances that will be used
 *     to load (and refresh) the manifest.
 * @param manifestParser A parser for loaded manifest data.
 * @param chunkSourceFactory A factory for {@link SsChunkSource} instances.
 * @param minLoadableRetryCount The minimum number of times to retry if a loading error occurs.
 * @param livePresentationDelayMs For live playbacks, the duration in milliseconds by which the
 *     default start position should precede the end of the live window.
 * @param eventHandler A handler for events. May be null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @deprecated Use {@link Factory} instead.
 */
@Deprecated
public SsMediaSource(
    Uri manifestUri,
    DataSource.Factory manifestDataSourceFactory,
    ParsingLoadable.Parser<? extends SsManifest> manifestParser,
    SsChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount,
    long livePresentationDelayMs,
    Handler eventHandler,
    MediaSourceEventListener eventListener) {
  this(
      /* manifest= */ null,
      manifestUri,
      manifestDataSourceFactory,
      manifestParser,
      chunkSourceFactory,
      new DefaultCompositeSequenceableLoaderFactory(),
      minLoadableRetryCount,
      livePresentationDelayMs,
      /* tag= */ null);
  if (eventHandler != null && eventListener != null) {
    addEventListener(eventHandler, eventListener);
  }
}
 
Example #9
Source File: SsMediaSource.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs an instance to play a given {@link SsManifest}, which must not be live.
 *
 * @param manifest The manifest. {@link SsManifest#isLive} must be false.
 * @param chunkSourceFactory A factory for {@link SsChunkSource} instances.
 * @param minLoadableRetryCount The minimum number of times to retry if a loading error occurs.
 * @param eventHandler A handler for events. May be null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @deprecated Use {@link Factory} instead.
 */
@Deprecated
public SsMediaSource(
    SsManifest manifest,
    SsChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount,
    Handler eventHandler,
    MediaSourceEventListener eventListener) {
  this(
      manifest,
      /* manifestUri= */ null,
      /* manifestDataSourceFactory= */ null,
      /* manifestParser= */ null,
      chunkSourceFactory,
      new DefaultCompositeSequenceableLoaderFactory(),
      minLoadableRetryCount,
      DEFAULT_LIVE_PRESENTATION_DELAY_MS,
      /* tag= */ null);
  if (eventHandler != null && eventListener != null) {
    addEventListener(eventHandler, eventListener);
  }
}
 
Example #10
Source File: SsMediaSource.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs an instance to play the manifest at a given {@link Uri}, which may be live or
 * on-demand.
 *
 * @param manifestUri The manifest {@link Uri}.
 * @param manifestDataSourceFactory A factory for {@link DataSource} instances that will be used
 *     to load (and refresh) the manifest.
 * @param manifestParser A parser for loaded manifest data.
 * @param chunkSourceFactory A factory for {@link SsChunkSource} instances.
 * @param minLoadableRetryCount The minimum number of times to retry if a loading error occurs.
 * @param livePresentationDelayMs For live playbacks, the duration in milliseconds by which the
 *     default start position should precede the end of the live window.
 * @param eventHandler A handler for events. May be null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @deprecated Use {@link Factory} instead.
 */
@Deprecated
public SsMediaSource(
    Uri manifestUri,
    DataSource.Factory manifestDataSourceFactory,
    ParsingLoadable.Parser<? extends SsManifest> manifestParser,
    SsChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount,
    long livePresentationDelayMs,
    Handler eventHandler,
    MediaSourceEventListener eventListener) {
  this(
      /* manifest= */ null,
      manifestUri,
      manifestDataSourceFactory,
      manifestParser,
      chunkSourceFactory,
      new DefaultCompositeSequenceableLoaderFactory(),
      minLoadableRetryCount,
      livePresentationDelayMs,
      /* tag= */ null);
  if (eventHandler != null && eventListener != null) {
    addEventListener(eventHandler, eventListener);
  }
}
 
Example #11
Source File: SsMediaSource.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs an instance to play a given {@link SsManifest}, which must not be live.
 *
 * @param manifest The manifest. {@link SsManifest#isLive} must be false.
 * @param chunkSourceFactory A factory for {@link SsChunkSource} instances.
 * @param minLoadableRetryCount The minimum number of times to retry if a loading error occurs.
 * @param eventHandler A handler for events. May be null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @deprecated Use {@link Factory} instead.
 */
@Deprecated
public SsMediaSource(
    SsManifest manifest,
    SsChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount,
    Handler eventHandler,
    MediaSourceEventListener eventListener) {
  this(
      manifest,
      /* manifestUri= */ null,
      /* manifestDataSourceFactory= */ null,
      /* manifestParser= */ null,
      chunkSourceFactory,
      new DefaultCompositeSequenceableLoaderFactory(),
      minLoadableRetryCount,
      DEFAULT_LIVE_PRESENTATION_DELAY_MS,
      /* tag= */ null);
  if (eventHandler != null && eventListener != null) {
    addEventListener(eventHandler, eventListener);
  }
}
 
Example #12
Source File: DashMediaSource.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs an instance to play a given {@link DashManifest}, which must be static.
 *
 * @param manifest The manifest. {@link DashManifest#dynamic} must be false.
 * @param chunkSourceFactory A factory for {@link DashChunkSource} instances.
 * @param minLoadableRetryCount The minimum number of times to retry if a loading error occurs.
 * @param eventHandler A handler for events. May be null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @deprecated Use {@link Factory} instead.
 */
@Deprecated
public DashMediaSource(
    DashManifest manifest,
    DashChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount,
    Handler eventHandler,
    MediaSourceEventListener eventListener) {
  this(
      manifest,
      /* manifestUri= */ null,
      /* manifestDataSourceFactory= */ null,
      /* manifestParser= */ null,
      chunkSourceFactory,
      new DefaultCompositeSequenceableLoaderFactory(),
      minLoadableRetryCount,
      DEFAULT_LIVE_PRESENTATION_DELAY_MS,
      /* livePresentationDelayOverridesManifest= */ false,
      /* tag= */ null);
  if (eventHandler != null && eventListener != null) {
    addEventListener(eventHandler, eventListener);
  }
}
 
Example #13
Source File: DashMediaSource.java    From MediaSDK with Apache License 2.0 6 votes vote down vote up
/**
 * Constructs an instance to play a given {@link DashManifest}, which must be static.
 *
 * @param manifest The manifest. {@link DashManifest#dynamic} must be false.
 * @param chunkSourceFactory A factory for {@link DashChunkSource} instances.
 * @param minLoadableRetryCount The minimum number of times to retry if a loading error occurs.
 * @param eventHandler A handler for events. May be null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @deprecated Use {@link Factory} instead.
 */
@Deprecated
public DashMediaSource(
    DashManifest manifest,
    DashChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount,
    @Nullable Handler eventHandler,
    @Nullable MediaSourceEventListener eventListener) {
  this(
      manifest,
      /* manifestUri= */ null,
      /* manifestDataSourceFactory= */ null,
      /* manifestParser= */ null,
      chunkSourceFactory,
      new DefaultCompositeSequenceableLoaderFactory(),
      DrmSessionManager.getDummyDrmSessionManager(),
      new DefaultLoadErrorHandlingPolicy(minLoadableRetryCount),
      DEFAULT_LIVE_PRESENTATION_DELAY_MS,
      /* livePresentationDelayOverridesManifest= */ false,
      /* tag= */ null);
  if (eventHandler != null && eventListener != null) {
    addEventListener(eventHandler, eventListener);
  }
}
 
Example #14
Source File: SsMediaSource.java    From MediaSDK with Apache License 2.0 6 votes vote down vote up
/**
 * Constructs an instance to play a given {@link SsManifest}, which must not be live.
 *
 * @param manifest The manifest. {@link SsManifest#isLive} must be false.
 * @param chunkSourceFactory A factory for {@link SsChunkSource} instances.
 * @param minLoadableRetryCount The minimum number of times to retry if a loading error occurs.
 * @param eventHandler A handler for events. May be null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @deprecated Use {@link Factory} instead.
 */
@Deprecated
public SsMediaSource(
    SsManifest manifest,
    SsChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount,
    @Nullable Handler eventHandler,
    @Nullable MediaSourceEventListener eventListener) {
  this(
      manifest,
      /* manifestUri= */ null,
      /* manifestDataSourceFactory= */ null,
      /* manifestParser= */ null,
      chunkSourceFactory,
      new DefaultCompositeSequenceableLoaderFactory(),
      DrmSessionManager.getDummyDrmSessionManager(),
      new DefaultLoadErrorHandlingPolicy(minLoadableRetryCount),
      DEFAULT_LIVE_PRESENTATION_DELAY_MS,
      /* tag= */ null);
  if (eventHandler != null && eventListener != null) {
    addEventListener(eventHandler, eventListener);
  }
}
 
Example #15
Source File: SsMediaSource.java    From MediaSDK with Apache License 2.0 6 votes vote down vote up
/**
 * Constructs an instance to play the manifest at a given {@link Uri}, which may be live or
 * on-demand.
 *
 * @param manifestUri The manifest {@link Uri}.
 * @param manifestDataSourceFactory A factory for {@link DataSource} instances that will be used
 *     to load (and refresh) the manifest.
 * @param manifestParser A parser for loaded manifest data.
 * @param chunkSourceFactory A factory for {@link SsChunkSource} instances.
 * @param minLoadableRetryCount The minimum number of times to retry if a loading error occurs.
 * @param livePresentationDelayMs For live playbacks, the duration in milliseconds by which the
 *     default start position should precede the end of the live window.
 * @param eventHandler A handler for events. May be null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @deprecated Use {@link Factory} instead.
 */
@Deprecated
public SsMediaSource(
    Uri manifestUri,
    DataSource.Factory manifestDataSourceFactory,
    ParsingLoadable.Parser<? extends SsManifest> manifestParser,
    SsChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount,
    long livePresentationDelayMs,
    @Nullable Handler eventHandler,
    @Nullable MediaSourceEventListener eventListener) {
  this(
      /* manifest= */ null,
      manifestUri,
      manifestDataSourceFactory,
      manifestParser,
      chunkSourceFactory,
      new DefaultCompositeSequenceableLoaderFactory(),
      DrmSessionManager.getDummyDrmSessionManager(),
      new DefaultLoadErrorHandlingPolicy(minLoadableRetryCount),
      livePresentationDelayMs,
      /* tag= */ null);
  if (eventHandler != null && eventListener != null) {
    addEventListener(eventHandler, eventListener);
  }
}
 
Example #16
Source File: DashMediaSource.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new factory for {@link DashMediaSource}s.
 *
 * @param chunkSourceFactory A factory for {@link DashChunkSource} instances.
 * @param manifestDataSourceFactory A factory for {@link DataSource} instances that will be used
 *     to load (and refresh) the manifest. May be {@code null} if the factory will only ever be
 *     used to create create media sources with sideloaded manifests via {@link
 *     #createMediaSource(DashManifest, Handler, MediaSourceEventListener)}.
 */
public Factory(
    DashChunkSource.Factory chunkSourceFactory,
    @Nullable DataSource.Factory manifestDataSourceFactory) {
  this.chunkSourceFactory = Assertions.checkNotNull(chunkSourceFactory);
  this.manifestDataSourceFactory = manifestDataSourceFactory;
  loadErrorHandlingPolicy = new DefaultLoadErrorHandlingPolicy();
  livePresentationDelayMs = DEFAULT_LIVE_PRESENTATION_DELAY_MS;
  compositeSequenceableLoaderFactory = new DefaultCompositeSequenceableLoaderFactory();
}
 
Example #17
Source File: DashMediaSource.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new factory for {@link DashMediaSource}s.
 *
 * @param chunkSourceFactory A factory for {@link DashChunkSource} instances.
 * @param manifestDataSourceFactory A factory for {@link DataSource} instances that will be used
 *     to load (and refresh) the manifest. May be {@code null} if the factory will only ever be
 *     used to create create media sources with sideloaded manifests via {@link
 *     #createMediaSource(DashManifest, Handler, MediaSourceEventListener)}.
 */
public Factory(
    DashChunkSource.Factory chunkSourceFactory,
    @Nullable DataSource.Factory manifestDataSourceFactory) {
  this.chunkSourceFactory = Assertions.checkNotNull(chunkSourceFactory);
  this.manifestDataSourceFactory = manifestDataSourceFactory;
  drmSessionManager = DrmSessionManager.getDummyDrmSessionManager();
  loadErrorHandlingPolicy = new DefaultLoadErrorHandlingPolicy();
  livePresentationDelayMs = DEFAULT_LIVE_PRESENTATION_DELAY_MS;
  compositeSequenceableLoaderFactory = new DefaultCompositeSequenceableLoaderFactory();
}
 
Example #18
Source File: SsMediaSource.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new factory for {@link SsMediaSource}s.
 *
 * @param chunkSourceFactory A factory for {@link SsChunkSource} instances.
 * @param manifestDataSourceFactory A factory for {@link DataSource} instances that will be used
 *     to load (and refresh) the manifest. May be {@code null} if the factory will only ever be
 *     used to create create media sources with sideloaded manifests via {@link
 *     #createMediaSource(SsManifest, Handler, MediaSourceEventListener)}.
 */
public Factory(
    SsChunkSource.Factory chunkSourceFactory,
    @Nullable DataSource.Factory manifestDataSourceFactory) {
  this.chunkSourceFactory = Assertions.checkNotNull(chunkSourceFactory);
  this.manifestDataSourceFactory = manifestDataSourceFactory;
  loadErrorHandlingPolicy = new DefaultLoadErrorHandlingPolicy();
  livePresentationDelayMs = DEFAULT_LIVE_PRESENTATION_DELAY_MS;
  compositeSequenceableLoaderFactory = new DefaultCompositeSequenceableLoaderFactory();
}
 
Example #19
Source File: DashMediaSource.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructs an instance to play the manifest at a given {@link Uri}, which may be dynamic or
 * static.
 *
 * @param manifestUri The manifest {@link Uri}.
 * @param manifestDataSourceFactory A factory for {@link DataSource} instances that will be used
 *     to load (and refresh) the manifest.
 * @param manifestParser A parser for loaded manifest data.
 * @param chunkSourceFactory A factory for {@link DashChunkSource} instances.
 * @param minLoadableRetryCount The minimum number of times to retry if a loading error occurs.
 * @param livePresentationDelayMs For live playbacks, the duration in milliseconds by which the
 *     default start position should precede the end of the live window. Use {@link
 *     #DEFAULT_LIVE_PRESENTATION_DELAY_PREFER_MANIFEST_MS} to use the value specified by the
 *     manifest, if present.
 * @param eventHandler A handler for events. May be null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @deprecated Use {@link Factory} instead.
 */
@Deprecated
@SuppressWarnings("deprecation")
public DashMediaSource(
    Uri manifestUri,
    DataSource.Factory manifestDataSourceFactory,
    ParsingLoadable.Parser<? extends DashManifest> manifestParser,
    DashChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount,
    long livePresentationDelayMs,
    Handler eventHandler,
    MediaSourceEventListener eventListener) {
  this(
      /* manifest= */ null,
      manifestUri,
      manifestDataSourceFactory,
      manifestParser,
      chunkSourceFactory,
      new DefaultCompositeSequenceableLoaderFactory(),
      new DefaultLoadErrorHandlingPolicy(minLoadableRetryCount),
      livePresentationDelayMs == DEFAULT_LIVE_PRESENTATION_DELAY_PREFER_MANIFEST_MS
          ? DEFAULT_LIVE_PRESENTATION_DELAY_MS
          : livePresentationDelayMs,
      livePresentationDelayMs != DEFAULT_LIVE_PRESENTATION_DELAY_PREFER_MANIFEST_MS,
      /* tag= */ null);
  if (eventHandler != null && eventListener != null) {
    addEventListener(eventHandler, eventListener);
  }
}
 
Example #20
Source File: DashMediaSource.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
/**
 * Constructs an instance to play the manifest at a given {@link Uri}, which may be dynamic or
 * static.
 *
 * @param manifestUri The manifest {@link Uri}.
 * @param manifestDataSourceFactory A factory for {@link DataSource} instances that will be used
 *     to load (and refresh) the manifest.
 * @param manifestParser A parser for loaded manifest data.
 * @param chunkSourceFactory A factory for {@link DashChunkSource} instances.
 * @param minLoadableRetryCount The minimum number of times to retry if a loading error occurs.
 * @param livePresentationDelayMs For live playbacks, the duration in milliseconds by which the
 *     default start position should precede the end of the live window. Use {@link
 *     #DEFAULT_LIVE_PRESENTATION_DELAY_PREFER_MANIFEST_MS} to use the value specified by the
 *     manifest, if present.
 * @param eventHandler A handler for events. May be null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @deprecated Use {@link Factory} instead.
 */
@Deprecated
@SuppressWarnings("deprecation")
public DashMediaSource(
    Uri manifestUri,
    DataSource.Factory manifestDataSourceFactory,
    ParsingLoadable.Parser<? extends DashManifest> manifestParser,
    DashChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount,
    long livePresentationDelayMs,
    @Nullable Handler eventHandler,
    @Nullable MediaSourceEventListener eventListener) {
  this(
      /* manifest= */ null,
      manifestUri,
      manifestDataSourceFactory,
      manifestParser,
      chunkSourceFactory,
      new DefaultCompositeSequenceableLoaderFactory(),
      DrmSessionManager.getDummyDrmSessionManager(),
      new DefaultLoadErrorHandlingPolicy(minLoadableRetryCount),
      livePresentationDelayMs == DEFAULT_LIVE_PRESENTATION_DELAY_PREFER_MANIFEST_MS
          ? DEFAULT_LIVE_PRESENTATION_DELAY_MS
          : livePresentationDelayMs,
      livePresentationDelayMs != DEFAULT_LIVE_PRESENTATION_DELAY_PREFER_MANIFEST_MS,
      /* tag= */ null);
  if (eventHandler != null && eventListener != null) {
    addEventListener(eventHandler, eventListener);
  }
}
 
Example #21
Source File: DashMediaSource.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new factory for {@link DashMediaSource}s.
 *
 * @param chunkSourceFactory A factory for {@link DashChunkSource} instances.
 * @param manifestDataSourceFactory A factory for {@link DataSource} instances that will be used
 *     to load (and refresh) the manifest. May be {@code null} if the factory will only ever be
 *     used to create create media sources with sideloaded manifests via {@link
 *     #createMediaSource(DashManifest, Handler, MediaSourceEventListener)}.
 */
public Factory(
    DashChunkSource.Factory chunkSourceFactory,
    @Nullable DataSource.Factory manifestDataSourceFactory) {
  this.chunkSourceFactory = Assertions.checkNotNull(chunkSourceFactory);
  this.manifestDataSourceFactory = manifestDataSourceFactory;
  loadErrorHandlingPolicy = new DefaultLoadErrorHandlingPolicy();
  livePresentationDelayMs = DEFAULT_LIVE_PRESENTATION_DELAY_MS;
  compositeSequenceableLoaderFactory = new DefaultCompositeSequenceableLoaderFactory();
}
 
Example #22
Source File: HlsMediaSource.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new factory for {@link HlsMediaSource}s.
 *
 * @param hlsDataSourceFactory An {@link HlsDataSourceFactory} for {@link DataSource}s for
 *     manifests, segments and keys.
 */
public Factory(HlsDataSourceFactory hlsDataSourceFactory) {
  this.hlsDataSourceFactory = Assertions.checkNotNull(hlsDataSourceFactory);
  playlistParserFactory = new DefaultHlsPlaylistParserFactory();
  playlistTrackerFactory = DefaultHlsPlaylistTracker.FACTORY;
  extractorFactory = HlsExtractorFactory.DEFAULT;
  loadErrorHandlingPolicy = new DefaultLoadErrorHandlingPolicy();
  compositeSequenceableLoaderFactory = new DefaultCompositeSequenceableLoaderFactory();
  metadataType = HlsMetadataType.ID3;
}
 
Example #23
Source File: SsMediaSource.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new factory for {@link SsMediaSource}s.
 *
 * @param chunkSourceFactory A factory for {@link SsChunkSource} instances.
 * @param manifestDataSourceFactory A factory for {@link DataSource} instances that will be used
 *     to load (and refresh) the manifest. May be {@code null} if the factory will only ever be
 *     used to create create media sources with sideloaded manifests via {@link
 *     #createMediaSource(SsManifest, Handler, MediaSourceEventListener)}.
 */
public Factory(
    SsChunkSource.Factory chunkSourceFactory,
    @Nullable DataSource.Factory manifestDataSourceFactory) {
  this.chunkSourceFactory = Assertions.checkNotNull(chunkSourceFactory);
  this.manifestDataSourceFactory = manifestDataSourceFactory;
  drmSessionManager = DrmSessionManager.getDummyDrmSessionManager();
  loadErrorHandlingPolicy = new DefaultLoadErrorHandlingPolicy();
  livePresentationDelayMs = DEFAULT_LIVE_PRESENTATION_DELAY_MS;
  compositeSequenceableLoaderFactory = new DefaultCompositeSequenceableLoaderFactory();
}
 
Example #24
Source File: SsMediaSource.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new factory for {@link SsMediaSource}s.
 *
 * @param chunkSourceFactory A factory for {@link SsChunkSource} instances.
 * @param manifestDataSourceFactory A factory for {@link DataSource} instances that will be used
 *     to load (and refresh) the manifest. May be {@code null} if the factory will only ever be
 *     used to create create media sources with sideloaded manifests via {@link
 *     #createMediaSource(SsManifest, Handler, MediaSourceEventListener)}.
 */
public Factory(
    SsChunkSource.Factory chunkSourceFactory,
    @Nullable DataSource.Factory manifestDataSourceFactory) {
  this.chunkSourceFactory = Assertions.checkNotNull(chunkSourceFactory);
  this.manifestDataSourceFactory = manifestDataSourceFactory;
  loadErrorHandlingPolicy = new DefaultLoadErrorHandlingPolicy();
  livePresentationDelayMs = DEFAULT_LIVE_PRESENTATION_DELAY_MS;
  compositeSequenceableLoaderFactory = new DefaultCompositeSequenceableLoaderFactory();
}
 
Example #25
Source File: DashMediaSource.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructs an instance to play the manifest at a given {@link Uri}, which may be dynamic or
 * static.
 *
 * @param manifestUri The manifest {@link Uri}.
 * @param manifestDataSourceFactory A factory for {@link DataSource} instances that will be used
 *     to load (and refresh) the manifest.
 * @param manifestParser A parser for loaded manifest data.
 * @param chunkSourceFactory A factory for {@link DashChunkSource} instances.
 * @param minLoadableRetryCount The minimum number of times to retry if a loading error occurs.
 * @param livePresentationDelayMs For live playbacks, the duration in milliseconds by which the
 *     default start position should precede the end of the live window. Use {@link
 *     #DEFAULT_LIVE_PRESENTATION_DELAY_PREFER_MANIFEST_MS} to use the value specified by the
 *     manifest, if present.
 * @param eventHandler A handler for events. May be null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @deprecated Use {@link Factory} instead.
 */
@Deprecated
@SuppressWarnings("deprecation")
public DashMediaSource(
    Uri manifestUri,
    DataSource.Factory manifestDataSourceFactory,
    ParsingLoadable.Parser<? extends DashManifest> manifestParser,
    DashChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount,
    long livePresentationDelayMs,
    Handler eventHandler,
    MediaSourceEventListener eventListener) {
  this(
      /* manifest= */ null,
      manifestUri,
      manifestDataSourceFactory,
      manifestParser,
      chunkSourceFactory,
      new DefaultCompositeSequenceableLoaderFactory(),
      new DefaultLoadErrorHandlingPolicy(minLoadableRetryCount),
      livePresentationDelayMs == DEFAULT_LIVE_PRESENTATION_DELAY_PREFER_MANIFEST_MS
          ? DEFAULT_LIVE_PRESENTATION_DELAY_MS
          : livePresentationDelayMs,
      livePresentationDelayMs != DEFAULT_LIVE_PRESENTATION_DELAY_PREFER_MANIFEST_MS,
      /* tag= */ null);
  if (eventHandler != null && eventListener != null) {
    addEventListener(eventHandler, eventListener);
  }
}
 
Example #26
Source File: DashMediaSource.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructs an instance to play the manifest at a given {@link Uri}, which may be dynamic or
 * static.
 *
 * @param manifestUri The manifest {@link Uri}.
 * @param manifestDataSourceFactory A factory for {@link DataSource} instances that will be used
 *     to load (and refresh) the manifest.
 * @param manifestParser A parser for loaded manifest data.
 * @param chunkSourceFactory A factory for {@link DashChunkSource} instances.
 * @param minLoadableRetryCount The minimum number of times to retry if a loading error occurs.
 * @param livePresentationDelayMs For live playbacks, the duration in milliseconds by which the
 *     default start position should precede the end of the live window. Use {@link
 *     #DEFAULT_LIVE_PRESENTATION_DELAY_PREFER_MANIFEST_MS} to use the value specified by the
 *     manifest, if present.
 * @param eventHandler A handler for events. May be null if delivery of events is not required.
 * @param eventListener A listener of events. May be null if delivery of events is not required.
 * @deprecated Use {@link Factory} instead.
 */
@Deprecated
@SuppressWarnings("deprecation")
public DashMediaSource(
    Uri manifestUri,
    DataSource.Factory manifestDataSourceFactory,
    ParsingLoadable.Parser<? extends DashManifest> manifestParser,
    DashChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount,
    long livePresentationDelayMs,
    Handler eventHandler,
    MediaSourceEventListener eventListener) {
  this(
      /* manifest= */ null,
      manifestUri,
      manifestDataSourceFactory,
      manifestParser,
      chunkSourceFactory,
      new DefaultCompositeSequenceableLoaderFactory(),
      minLoadableRetryCount,
      livePresentationDelayMs == DEFAULT_LIVE_PRESENTATION_DELAY_PREFER_MANIFEST_MS
          ? DEFAULT_LIVE_PRESENTATION_DELAY_MS
          : livePresentationDelayMs,
      livePresentationDelayMs != DEFAULT_LIVE_PRESENTATION_DELAY_PREFER_MANIFEST_MS,
      /* tag= */ null);
  if (eventHandler != null && eventListener != null) {
    addEventListener(eventHandler, eventListener);
  }
}
 
Example #27
Source File: HlsMediaSource.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new factory for {@link HlsMediaSource}s.
 *
 * @param hlsDataSourceFactory An {@link HlsDataSourceFactory} for {@link DataSource}s for
 *     manifests, segments and keys.
 */
public Factory(HlsDataSourceFactory hlsDataSourceFactory) {
  this.hlsDataSourceFactory = Assertions.checkNotNull(hlsDataSourceFactory);
  playlistParserFactory = new DefaultHlsPlaylistParserFactory();
  playlistTrackerFactory = DefaultHlsPlaylistTracker.FACTORY;
  extractorFactory = HlsExtractorFactory.DEFAULT;
  loadErrorHandlingPolicy = new DefaultLoadErrorHandlingPolicy();
  compositeSequenceableLoaderFactory = new DefaultCompositeSequenceableLoaderFactory();
  metadataType = HlsMetadataType.ID3;
}
 
Example #28
Source File: HlsMediaSource.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new factory for {@link HlsMediaSource}s.
 *
 * @param hlsDataSourceFactory An {@link HlsDataSourceFactory} for {@link DataSource}s for
 *     manifests, segments and keys.
 */
public Factory(HlsDataSourceFactory hlsDataSourceFactory) {
  this.hlsDataSourceFactory = Assertions.checkNotNull(hlsDataSourceFactory);
  extractorFactory = HlsExtractorFactory.DEFAULT;
  chunkLoadErrorHandlingPolicy = LoadErrorHandlingPolicy.getDefault();
  minLoadableRetryCount = DEFAULT_MIN_LOADABLE_RETRY_COUNT;
  compositeSequenceableLoaderFactory = new DefaultCompositeSequenceableLoaderFactory();
}
 
Example #29
Source File: HlsMediaSource.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param manifestUri The {@link Uri} of the HLS manifest.
 * @param dataSourceFactory An {@link HlsDataSourceFactory} for {@link DataSource}s for manifests,
 *     segments and keys.
 * @param extractorFactory An {@link HlsExtractorFactory} for {@link Extractor}s for the segments.
 * @param minLoadableRetryCount The minimum number of times loads must be retried before errors
 *     are propagated.
 * @param eventHandler A handler for events. May be null if delivery of events is not required.
 * @param eventListener A {@link MediaSourceEventListener}. May be null if delivery of events is
 *     not required.
 * @param playlistParser A {@link ParsingLoadable.Parser} for HLS playlists.
 * @deprecated Use {@link Factory} instead.
 */
@Deprecated
public HlsMediaSource(
    Uri manifestUri,
    HlsDataSourceFactory dataSourceFactory,
    HlsExtractorFactory extractorFactory,
    int minLoadableRetryCount,
    Handler eventHandler,
    MediaSourceEventListener eventListener,
    ParsingLoadable.Parser<HlsPlaylist> playlistParser) {
  this(
      manifestUri,
      dataSourceFactory,
      extractorFactory,
      new DefaultCompositeSequenceableLoaderFactory(),
      LoadErrorHandlingPolicy.getDefault(),
      minLoadableRetryCount,
      new DefaultHlsPlaylistTracker(
          dataSourceFactory,
          LoadErrorHandlingPolicy.getDefault(),
          minLoadableRetryCount,
          playlistParser),
      /* allowChunklessPreparation= */ false,
      /* tag= */ null);
  if (eventHandler != null && eventListener != null) {
    addEventListener(eventHandler, eventListener);
  }
}
 
Example #30
Source File: SsMediaSource.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new factory for {@link SsMediaSource}s.
 *
 * @param chunkSourceFactory A factory for {@link SsChunkSource} instances.
 * @param manifestDataSourceFactory A factory for {@link DataSource} instances that will be used
 *     to load (and refresh) the manifest. May be {@code null} if the factory will only ever be
 *     used to create create media sources with sideloaded manifests via {@link
 *     #createMediaSource(SsManifest, Handler, MediaSourceEventListener)}.
 */
public Factory(
    SsChunkSource.Factory chunkSourceFactory,
    @Nullable DataSource.Factory manifestDataSourceFactory) {
  this.chunkSourceFactory = Assertions.checkNotNull(chunkSourceFactory);
  this.manifestDataSourceFactory = manifestDataSourceFactory;
  minLoadableRetryCount = DEFAULT_MIN_LOADABLE_RETRY_COUNT;
  livePresentationDelayMs = DEFAULT_LIVE_PRESENTATION_DELAY_MS;
  compositeSequenceableLoaderFactory = new DefaultCompositeSequenceableLoaderFactory();
}