com.google.android.exoplayer2.source.smoothstreaming.manifest.SsManifestParser Java Examples

The following examples show how to use com.google.android.exoplayer2.source.smoothstreaming.manifest.SsManifestParser. 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: SsMediaSource.java    From K-Sonic with MIT License 6 votes vote down vote up
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<>();
}
 
Example #2
Source File: SsDownloader.java    From MediaSDK with Apache License 2.0 4 votes vote down vote up
@Override
protected SsManifest getManifest(DataSource dataSource, DataSpec dataSpec) throws IOException {
  return ParsingLoadable.load(dataSource, new SsManifestParser(), dataSpec, C.DATA_TYPE_MANIFEST);
}
 
Example #3
Source File: SsDownloadHelper.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void prepareInternal() throws IOException {
  DataSource dataSource = manifestDataSourceFactory.createDataSource();
  manifest = ParsingLoadable.load(dataSource, new SsManifestParser(), uri, C.DATA_TYPE_MANIFEST);
}
 
Example #4
Source File: SsDownloader.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected SsManifest getManifest(DataSource dataSource, Uri uri) throws IOException {
  return ParsingLoadable.load(dataSource, new SsManifestParser(), uri, C.DATA_TYPE_MANIFEST);
}
 
Example #5
Source File: SsDownloadHelper.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void prepareInternal() throws IOException {
  DataSource dataSource = manifestDataSourceFactory.createDataSource();
  manifest = ParsingLoadable.load(dataSource, new SsManifestParser(), uri, C.DATA_TYPE_MANIFEST);
}
 
Example #6
Source File: SsDownloader.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected SsManifest getManifest(DataSource dataSource, Uri uri) throws IOException {
  return ParsingLoadable.load(dataSource, new SsManifestParser(), uri, C.DATA_TYPE_MANIFEST);
}
 
Example #7
Source File: SsDownloader.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected SsManifest getManifest(DataSource dataSource, DataSpec dataSpec) throws IOException {
  return ParsingLoadable.load(dataSource, new SsManifestParser(), dataSpec, C.DATA_TYPE_MANIFEST);
}
 
Example #8
Source File: SsDownloader.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected SsManifest getManifest(DataSource dataSource, DataSpec dataSpec) throws IOException {
  return ParsingLoadable.load(dataSource, new SsManifestParser(), dataSpec, C.DATA_TYPE_MANIFEST);
}
 
Example #9
Source File: SsMediaSource.java    From MediaSDK with Apache License 2.0 3 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 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
@SuppressWarnings("deprecation")
public SsMediaSource(
    Uri manifestUri,
    DataSource.Factory manifestDataSourceFactory,
    SsChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount,
    long livePresentationDelayMs,
    @Nullable Handler eventHandler,
    @Nullable MediaSourceEventListener eventListener) {
  this(manifestUri, manifestDataSourceFactory, new SsManifestParser(), chunkSourceFactory,
      minLoadableRetryCount, livePresentationDelayMs, eventHandler, eventListener);
}
 
Example #10
Source File: SsMediaSource.java    From TelePlus-Android with GNU General Public License v2.0 3 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 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,
    SsChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount,
    long livePresentationDelayMs,
    Handler eventHandler,
    MediaSourceEventListener eventListener) {
  this(manifestUri, manifestDataSourceFactory, new SsManifestParser(), chunkSourceFactory,
      minLoadableRetryCount, livePresentationDelayMs, eventHandler, eventListener);
}
 
Example #11
Source File: SsMediaSource.java    From TelePlus-Android with GNU General Public License v2.0 3 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 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,
    SsChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount,
    long livePresentationDelayMs,
    Handler eventHandler,
    MediaSourceEventListener eventListener) {
  this(manifestUri, manifestDataSourceFactory, new SsManifestParser(), chunkSourceFactory,
      minLoadableRetryCount, livePresentationDelayMs, eventHandler, eventListener);
}
 
Example #12
Source File: SsMediaSource.java    From K-Sonic with MIT License 3 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 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.
 */
public SsMediaSource(Uri manifestUri, DataSource.Factory manifestDataSourceFactory,
    SsChunkSource.Factory chunkSourceFactory, int minLoadableRetryCount,
    long livePresentationDelayMs, Handler eventHandler,
    AdaptiveMediaSourceEventListener eventListener) {
  this(manifestUri, manifestDataSourceFactory, new SsManifestParser(), chunkSourceFactory,
      minLoadableRetryCount, livePresentationDelayMs, eventHandler, eventListener);
}
 
Example #13
Source File: SsMediaSource.java    From K-Sonic with MIT License 3 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.
 */
public SsMediaSource(Uri manifestUri, DataSource.Factory manifestDataSourceFactory,
    SsManifestParser manifestParser, SsChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount, long livePresentationDelayMs, Handler eventHandler,
    AdaptiveMediaSourceEventListener eventListener) {
  this(null, manifestUri, manifestDataSourceFactory, manifestParser, chunkSourceFactory,
      minLoadableRetryCount, livePresentationDelayMs, eventHandler, eventListener);
}
 
Example #14
Source File: SsMediaSource.java    From Telegram-FOSS with GNU General Public License v2.0 3 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 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
@SuppressWarnings("deprecation")
public SsMediaSource(
    Uri manifestUri,
    DataSource.Factory manifestDataSourceFactory,
    SsChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount,
    long livePresentationDelayMs,
    Handler eventHandler,
    MediaSourceEventListener eventListener) {
  this(manifestUri, manifestDataSourceFactory, new SsManifestParser(), chunkSourceFactory,
      minLoadableRetryCount, livePresentationDelayMs, eventHandler, eventListener);
}
 
Example #15
Source File: SsMediaSource.java    From Telegram with GNU General Public License v2.0 3 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 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
@SuppressWarnings("deprecation")
public SsMediaSource(
    Uri manifestUri,
    DataSource.Factory manifestDataSourceFactory,
    SsChunkSource.Factory chunkSourceFactory,
    int minLoadableRetryCount,
    long livePresentationDelayMs,
    Handler eventHandler,
    MediaSourceEventListener eventListener) {
  this(manifestUri, manifestDataSourceFactory, new SsManifestParser(), chunkSourceFactory,
      minLoadableRetryCount, livePresentationDelayMs, eventHandler, eventListener);
}