Java Code Examples for com.google.android.exoplayer2.upstream.ParsingLoadable#Parser
The following examples show how to use
com.google.android.exoplayer2.upstream.ParsingLoadable#Parser .
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 TelePlus-Android with GNU General Public License v2.0 | 6 votes |
private SsMediaSource( SsManifest manifest, Uri manifestUri, DataSource.Factory manifestDataSourceFactory, ParsingLoadable.Parser<? extends SsManifest> manifestParser, SsChunkSource.Factory chunkSourceFactory, CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory, int minLoadableRetryCount, long livePresentationDelayMs, @Nullable Object tag) { Assertions.checkState(manifest == null || !manifest.isLive); this.manifest = manifest; this.manifestUri = manifestUri == null ? null : SsUtil.fixManifestUri(manifestUri); this.manifestDataSourceFactory = manifestDataSourceFactory; this.manifestParser = manifestParser; this.chunkSourceFactory = chunkSourceFactory; this.compositeSequenceableLoaderFactory = compositeSequenceableLoaderFactory; this.minLoadableRetryCount = minLoadableRetryCount; this.livePresentationDelayMs = livePresentationDelayMs; this.manifestEventDispatcher = createEventDispatcher(/* mediaPeriodId= */ null); this.tag = tag; sideloadedManifest = manifest != null; mediaPeriods = new ArrayList<>(); }
Example 2
Source File: SsMediaSource.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
/** * 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 3
Source File: SsMediaSource.java From MediaSDK with Apache License 2.0 | 6 votes |
private SsMediaSource( @Nullable SsManifest manifest, @Nullable Uri manifestUri, @Nullable DataSource.Factory manifestDataSourceFactory, @Nullable ParsingLoadable.Parser<? extends SsManifest> manifestParser, SsChunkSource.Factory chunkSourceFactory, CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory, DrmSessionManager<?> drmSessionManager, LoadErrorHandlingPolicy loadErrorHandlingPolicy, long livePresentationDelayMs, @Nullable Object tag) { Assertions.checkState(manifest == null || !manifest.isLive); this.manifest = manifest; this.manifestUri = manifestUri == null ? null : SsUtil.fixManifestUri(manifestUri); this.manifestDataSourceFactory = manifestDataSourceFactory; this.manifestParser = manifestParser; this.chunkSourceFactory = chunkSourceFactory; this.compositeSequenceableLoaderFactory = compositeSequenceableLoaderFactory; this.drmSessionManager = drmSessionManager; this.loadErrorHandlingPolicy = loadErrorHandlingPolicy; this.livePresentationDelayMs = livePresentationDelayMs; this.manifestEventDispatcher = createEventDispatcher(/* mediaPeriodId= */ null); this.tag = tag; sideloadedManifest = manifest != null; mediaPeriods = new ArrayList<>(); }
Example 4
Source File: SsMediaSource.java From Telegram with GNU General Public License v2.0 | 6 votes |
/** * 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 5
Source File: FilteringHlsPlaylistParserFactory.java From Telegram-FOSS with GNU General Public License v2.0 | 4 votes |
@Override public ParsingLoadable.Parser<HlsPlaylist> createPlaylistParser() { return new FilteringManifestParser<>( hlsPlaylistParserFactory.createPlaylistParser(), streamKeys); }
Example 6
Source File: DashMediaSource.java From TelePlus-Android with GNU General Public License v2.0 | 4 votes |
private DashMediaSource( DashManifest manifest, Uri manifestUri, DataSource.Factory manifestDataSourceFactory, ParsingLoadable.Parser<? extends DashManifest> manifestParser, DashChunkSource.Factory chunkSourceFactory, CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory, int minLoadableRetryCount, long livePresentationDelayMs, boolean livePresentationDelayOverridesManifest, @Nullable Object tag) { this.initialManifestUri = manifestUri; this.manifest = manifest; this.manifestUri = manifestUri; this.manifestDataSourceFactory = manifestDataSourceFactory; this.manifestParser = manifestParser; this.chunkSourceFactory = chunkSourceFactory; this.minLoadableRetryCount = minLoadableRetryCount; this.livePresentationDelayMs = livePresentationDelayMs; this.livePresentationDelayOverridesManifest = livePresentationDelayOverridesManifest; this.compositeSequenceableLoaderFactory = compositeSequenceableLoaderFactory; this.tag = tag; sideloadedManifest = manifest != null; manifestEventDispatcher = createEventDispatcher(/* mediaPeriodId= */ null); manifestUriLock = new Object(); periodsById = new SparseArray<>(); playerEmsgCallback = new DefaultPlayerEmsgCallback(); expiredManifestPublishTimeUs = C.TIME_UNSET; if (sideloadedManifest) { Assertions.checkState(!manifest.dynamic); manifestCallback = null; refreshManifestRunnable = null; simulateManifestRefreshRunnable = null; manifestLoadErrorThrower = new LoaderErrorThrower.Dummy(); } else { manifestCallback = new ManifestCallback(); manifestLoadErrorThrower = new ManifestLoadErrorThrower(); refreshManifestRunnable = new Runnable() { @Override public void run() { startLoadingManifest(); } }; simulateManifestRefreshRunnable = new Runnable() { @Override public void run() { processManifest(false); } }; } }
Example 7
Source File: FilteringHlsPlaylistParserFactory.java From Telegram-FOSS with GNU General Public License v2.0 | 4 votes |
@Override public ParsingLoadable.Parser<HlsPlaylist> createPlaylistParser( HlsMasterPlaylist masterPlaylist) { return new FilteringManifestParser<>( hlsPlaylistParserFactory.createPlaylistParser(masterPlaylist), streamKeys); }
Example 8
Source File: FilteringHlsPlaylistParserFactory.java From Telegram with GNU General Public License v2.0 | 4 votes |
@Override public ParsingLoadable.Parser<HlsPlaylist> createPlaylistParser() { return new FilteringManifestParser<>( hlsPlaylistParserFactory.createPlaylistParser(), streamKeys); }
Example 9
Source File: DefaultHlsPlaylistParserFactory.java From Telegram with GNU General Public License v2.0 | 4 votes |
@Override public ParsingLoadable.Parser<HlsPlaylist> createPlaylistParser( HlsMasterPlaylist masterPlaylist) { return new HlsPlaylistParser(masterPlaylist); }
Example 10
Source File: DashMediaSource.java From TelePlus-Android with GNU General Public License v2.0 | 4 votes |
private DashMediaSource( DashManifest manifest, Uri manifestUri, DataSource.Factory manifestDataSourceFactory, ParsingLoadable.Parser<? extends DashManifest> manifestParser, DashChunkSource.Factory chunkSourceFactory, CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory, int minLoadableRetryCount, long livePresentationDelayMs, boolean livePresentationDelayOverridesManifest, @Nullable Object tag) { this.initialManifestUri = manifestUri; this.manifest = manifest; this.manifestUri = manifestUri; this.manifestDataSourceFactory = manifestDataSourceFactory; this.manifestParser = manifestParser; this.chunkSourceFactory = chunkSourceFactory; this.minLoadableRetryCount = minLoadableRetryCount; this.livePresentationDelayMs = livePresentationDelayMs; this.livePresentationDelayOverridesManifest = livePresentationDelayOverridesManifest; this.compositeSequenceableLoaderFactory = compositeSequenceableLoaderFactory; this.tag = tag; sideloadedManifest = manifest != null; manifestEventDispatcher = createEventDispatcher(/* mediaPeriodId= */ null); manifestUriLock = new Object(); periodsById = new SparseArray<>(); playerEmsgCallback = new DefaultPlayerEmsgCallback(); expiredManifestPublishTimeUs = C.TIME_UNSET; if (sideloadedManifest) { Assertions.checkState(!manifest.dynamic); manifestCallback = null; refreshManifestRunnable = null; simulateManifestRefreshRunnable = null; manifestLoadErrorThrower = new LoaderErrorThrower.Dummy(); } else { manifestCallback = new ManifestCallback(); manifestLoadErrorThrower = new ManifestLoadErrorThrower(); refreshManifestRunnable = new Runnable() { @Override public void run() { startLoadingManifest(); } }; simulateManifestRefreshRunnable = new Runnable() { @Override public void run() { processManifest(false); } }; } }
Example 11
Source File: FilteringHlsPlaylistParserFactory.java From MediaSDK with Apache License 2.0 | 4 votes |
@Override public ParsingLoadable.Parser<HlsPlaylist> createPlaylistParser( HlsMasterPlaylist masterPlaylist) { return new FilteringManifestParser<>( hlsPlaylistParserFactory.createPlaylistParser(masterPlaylist), streamKeys); }
Example 12
Source File: HlsMediaSource.java From TelePlus-Android with GNU General Public License v2.0 | 3 votes |
/** * Sets the parser to parse HLS playlists. The default is an instance of {@link * HlsPlaylistParser}. * * <p>Must not be called after calling {@link #setPlaylistTracker} on the same builder. * * @param playlistParser A {@link ParsingLoadable.Parser} for HLS playlists. * @return This factory, for convenience. * @throws IllegalStateException If one of the {@code create} methods has already been called. */ public Factory setPlaylistParser(ParsingLoadable.Parser<HlsPlaylist> playlistParser) { Assertions.checkState(!isCreateCalled); Assertions.checkState(playlistTracker == null, "A playlist tracker has already been set."); this.playlistParser = Assertions.checkNotNull(playlistParser); return this; }
Example 13
Source File: DashMediaSource.java From TelePlus-Android with GNU General Public License v2.0 | 3 votes |
/** * Sets the manifest parser to parse loaded manifest data when loading a manifest URI. * * @param manifestParser A parser for loaded manifest data. * @return This factory, for convenience. * @throws IllegalStateException If one of the {@code create} methods has already been called. */ public Factory setManifestParser( ParsingLoadable.Parser<? extends DashManifest> manifestParser) { Assertions.checkState(!isCreateCalled); this.manifestParser = Assertions.checkNotNull(manifestParser); return this; }
Example 14
Source File: SsMediaSource.java From TelePlus-Android with GNU General Public License v2.0 | 2 votes |
/** * Sets the manifest parser to parse loaded manifest data when loading a manifest URI. * * @param manifestParser A parser for loaded manifest data. * @return This factory, for convenience. * @throws IllegalStateException If one of the {@code create} methods has already been called. */ public Factory setManifestParser(ParsingLoadable.Parser<? extends SsManifest> manifestParser) { Assertions.checkState(!isCreateCalled); this.manifestParser = Assertions.checkNotNull(manifestParser); return this; }
Example 15
Source File: HlsPlaylistParserFactory.java From Telegram with GNU General Public License v2.0 | 2 votes |
/** * Returns a playlist parser for playlists that were referenced by the given {@link * HlsMasterPlaylist}. Returned {@link HlsMediaPlaylist} instances may inherit attributes from * {@code masterPlaylist}. * * @param masterPlaylist The master playlist that referenced any parsed media playlists. * @return A parser for HLS playlists. */ ParsingLoadable.Parser<HlsPlaylist> createPlaylistParser(HlsMasterPlaylist masterPlaylist);
Example 16
Source File: HlsPlaylistParserFactory.java From MediaSDK with Apache License 2.0 | 2 votes |
/** * Returns a playlist parser for playlists that were referenced by the given {@link * HlsMasterPlaylist}. Returned {@link HlsMediaPlaylist} instances may inherit attributes from * {@code masterPlaylist}. * * @param masterPlaylist The master playlist that referenced any parsed media playlists. * @return A parser for HLS playlists. */ ParsingLoadable.Parser<HlsPlaylist> createPlaylistParser(HlsMasterPlaylist masterPlaylist);
Example 17
Source File: HlsPlaylistParserFactory.java From MediaSDK with Apache License 2.0 | 2 votes |
/** * Returns a stand-alone playlist parser. Playlists parsed by the returned parser do not inherit * any attributes from other playlists. */ ParsingLoadable.Parser<HlsPlaylist> createPlaylistParser();
Example 18
Source File: SsMediaSource.java From Telegram with GNU General Public License v2.0 | 2 votes |
/** * Sets the manifest parser to parse loaded manifest data when loading a manifest URI. * * @param manifestParser A parser for loaded manifest data. * @return This factory, for convenience. * @throws IllegalStateException If one of the {@code create} methods has already been called. */ public Factory setManifestParser(ParsingLoadable.Parser<? extends SsManifest> manifestParser) { Assertions.checkState(!isCreateCalled); this.manifestParser = Assertions.checkNotNull(manifestParser); return this; }
Example 19
Source File: HlsPlaylistParserFactory.java From Telegram-FOSS with GNU General Public License v2.0 | 2 votes |
/** * Returns a stand-alone playlist parser. Playlists parsed by the returned parser do not inherit * any attributes from other playlists. */ ParsingLoadable.Parser<HlsPlaylist> createPlaylistParser();
Example 20
Source File: HlsPlaylistParserFactory.java From Telegram-FOSS with GNU General Public License v2.0 | 2 votes |
/** * Returns a playlist parser for playlists that were referenced by the given {@link * HlsMasterPlaylist}. Returned {@link HlsMediaPlaylist} instances may inherit attributes from * {@code masterPlaylist}. * * @param masterPlaylist The master playlist that referenced any parsed media playlists. * @return A parser for HLS playlists. */ ParsingLoadable.Parser<HlsPlaylist> createPlaylistParser(HlsMasterPlaylist masterPlaylist);