Commit d6d7c410 by olly Committed by Oliver Woodman

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
parent b779b159
...@@ -56,6 +56,12 @@ public final class DashDownloadHelper extends DownloadHelper { ...@@ -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 { ...@@ -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 { ...@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment