@Override protected DashManifest getManifest(DataSource dataSource, Uri uri) throws IOException { return DashUtil.loadManifest(dataSource, uri); }
private DashDownloader downloadContent() throws Exception { DashManifest dashManifest = DashUtil.loadManifest(httpDataSourceFactory.createDataSource(), MANIFEST_URI); ArrayList<StreamKey> keys = new ArrayList<>(); for (int pIndex = 0; pIndex < dashManifest.getPeriodCount(); pIndex++) { List<AdaptationSet> adaptationSets = dashManifest.getPeriod(pIndex).adaptationSets; for (int aIndex = 0; aIndex < adaptationSets.size(); aIndex++) { AdaptationSet adaptationSet = adaptationSets.get(aIndex); List<Representation> representations = adaptationSet.representations; for (int rIndex = 0; rIndex < representations.size(); rIndex++) { String id = representations.get(rIndex).format.id; if (DashTestData.AAC_AUDIO_REPRESENTATION_ID.equals(id) || DashTestData.H264_CDD_FIXED.equals(id)) { keys.add(new StreamKey(pIndex, aIndex, rIndex)); } } } } DownloaderConstructorHelper constructorHelper = new DownloaderConstructorHelper(cache, httpDataSourceFactory); return new DashDownloader(MANIFEST_URI, keys, constructorHelper); }
private void downloadLicense() throws InterruptedException, DrmSessionException, IOException { DataSource dataSource = httpDataSourceFactory.createDataSource(); DashManifest dashManifest = DashUtil.loadManifest(dataSource, Uri.parse(DashTestData.WIDEVINE_H264_MANIFEST)); DrmInitData drmInitData = DashUtil.loadDrmInitData(dataSource, dashManifest.getPeriod(0)); offlineLicenseKeySetId = offlineLicenseHelper.downloadLicense(drmInitData); assertThat(offlineLicenseKeySetId).isNotNull(); assertThat(offlineLicenseKeySetId.length).isGreaterThan(0); testRunner.setOfflineLicenseKeySetId(offlineLicenseKeySetId); }