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:
olly 2018-05-10 14:11:36 -07:00 committed by Oliver Woodman
parent b779b1599f
commit d6d7c41065
3 changed files with 18 additions and 0 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);