mirror of
https://github.com/androidx/media.git
synced 2025-05-11 09:39:52 +08:00
Expose manifests/playlists from download helpers
This is useful to get hold of the manifest to then obtain DRM init data in the download flow for protected content (without having to download the manifest again). ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=196168938
This commit is contained in:
parent
b779b1599f
commit
d6d7c41065
@ -56,6 +56,12 @@ public final class DashDownloadHelper extends DownloadHelper {
|
|||||||
manifestDataSourceFactory.createDataSource(), new DashManifestParser(), uri);
|
manifestDataSourceFactory.createDataSource(), new DashManifestParser(), uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Returns the DASH manifest. Must not be called until after preparation completes. */
|
||||||
|
public DashManifest getManifest() {
|
||||||
|
Assertions.checkNotNull(manifest);
|
||||||
|
return manifest;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getPeriodCount() {
|
public int getPeriodCount() {
|
||||||
Assertions.checkNotNull(manifest);
|
Assertions.checkNotNull(manifest);
|
||||||
|
@ -57,6 +57,12 @@ public final class HlsDownloadHelper extends DownloadHelper {
|
|||||||
playlist = ParsingLoadable.load(dataSource, new HlsPlaylistParser(), uri);
|
playlist = ParsingLoadable.load(dataSource, new HlsPlaylistParser(), uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Returns the HLS playlist. Must not be called until after preparation completes. */
|
||||||
|
public HlsPlaylist getPlaylist() {
|
||||||
|
Assertions.checkNotNull(playlist);
|
||||||
|
return playlist;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getPeriodCount() {
|
public int getPeriodCount() {
|
||||||
Assertions.checkNotNull(playlist);
|
Assertions.checkNotNull(playlist);
|
||||||
|
@ -52,6 +52,12 @@ public final class SsDownloadHelper extends DownloadHelper {
|
|||||||
manifest = ParsingLoadable.load(dataSource, new SsManifestParser(), uri);
|
manifest = ParsingLoadable.load(dataSource, new SsManifestParser(), uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Returns the SmoothStreaming manifest. Must not be called until after preparation completes. */
|
||||||
|
public SsManifest getManifest() {
|
||||||
|
Assertions.checkNotNull(manifest);
|
||||||
|
return manifest;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getPeriodCount() {
|
public int getPeriodCount() {
|
||||||
Assertions.checkNotNull(manifest);
|
Assertions.checkNotNull(manifest);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user