private void testDashPlayback(HostActivity activity, String streamName, ActionSchedule actionSchedule, boolean fullPlaybackNoSeeking, String manifestFileName, String audioFormat, boolean canIncludeAdditionalVideoFormats, String... videoFormats) throws IOException { MediaPresentationDescription mpd = TestUtil.loadManifest(activity, TAG, MANIFEST_URL_PREFIX + manifestFileName, new MediaPresentationDescriptionParser()); MetricsLogger metricsLogger = MetricsLogger.Factory.createDefault(getInstrumentation(), TAG, REPORT_NAME, streamName); DashHostedTest test = new DashHostedTest(streamName, mpd, metricsLogger, fullPlaybackNoSeeking, audioFormat, canIncludeAdditionalVideoFormats, false, actionSchedule, videoFormats); activity.runTest(test, mpd.duration + MAX_ADDITIONAL_TIME_MS); // Retry test exactly once if adaptive test fails due to excessive dropped buffers when playing // non-CDD required formats (b/28220076). if (test.needsCddLimitedRetry) { metricsLogger = MetricsLogger.Factory.createDefault(getInstrumentation(), TAG, REPORT_NAME, streamName + "_cdd_limited_retry"); test = new DashHostedTest(streamName, mpd, metricsLogger, fullPlaybackNoSeeking, audioFormat, false, true, actionSchedule, videoFormats); activity.runTest(test, mpd.duration + MAX_ADDITIONAL_TIME_MS); } }
public AsyncRendererBuilder(Context context, String userAgent, String url, MediaDrmCallback drmCallback, DemoPlayer player) { this.context = context; this.userAgent = userAgent; this.drmCallback = drmCallback; this.player = player; MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser(); manifestDataSource = new DefaultUriDataSource(context, userAgent); manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser); }
public AsyncRendererBuilder(Context context, String userAgent, String url, MediaDrmCallback drmCallback, VideoPlayer player) { this.context = context; this.userAgent = userAgent; this.drmCallback = drmCallback; this.player = player; MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser(); manifestDataSource = new DefaultUriDataSource(context, userAgent); manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser); }
public AsyncRendererBuilder(Context context, String userAgent, String url, MediaDrmCallback drmCallback, AudioCapabilities audioCapabilities, MediaPlayer player) { this.context = context; this.userAgent = userAgent; this.drmCallback = drmCallback; this.audioCapabilities = audioCapabilities; this.player = player; MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser(); manifestDataSource = new DefaultUriDataSource(context, userAgent); manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser); }
public AsyncRendererBuilder(Context context, String userAgent, String url, MediaDrmCallback drmCallback, Player player) { this.context = context; this.userAgent = userAgent; this.drmCallback = drmCallback; this.player = player; MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser(); manifestDataSource = new DefaultUriDataSource(context, userAgent); manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser); }
public AsyncRendererBuilder(Context context, String userAgent, String url, DemoPlayer player) { this.context = context; this.userAgent = userAgent; this.player = player; MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser(); manifestDataSource = new DefaultUriDataSource(context, userAgent); manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser); }
public AsyncRendererBuilder(Context context, OkHttpClient okHttpClient, String userAgent, String url, EMExoPlayer player, int streamType) { this.context = context; this.userAgent = userAgent; this.streamType = streamType; this.player = player; this.okHttpClient = okHttpClient; MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser(); manifestDataSource = createManifestDataSource(context, userAgent); manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser); }
public AsyncRendererBuilder(Context context, String userAgent, String url, MediaDrmCallback drmCallback, ExoPlayerWrapper player) { this.context = context; this.userAgent = userAgent; this.drmCallback = drmCallback; this.player = player; MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser(); manifestDataSource = new DefaultUriDataSource(context, userAgent); manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser); }
@Override public void buildRenderers(DemoPlayer player, RendererBuilderCallback callback) { this.player = player; this.callback = callback; MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser(); manifestFetcher = new ManifestFetcher<MediaPresentationDescription>(parser, contentId, url, userAgent); manifestFetcher.singleLoad(player.getMainHandler().getLooper(), this); }
@Override public void buildRenderers(RendererBuilderCallback callback) { this.callback = callback; MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser(); manifestFetcher = new ManifestFetcher<MediaPresentationDescription>(parser, contentId, url, userAgent); manifestFetcher.singleLoad(playerActivity.getMainLooper(), this); }
public AsyncRendererBuilder(Context context, String userAgent, String url, MediaDrmCallback drmCallback, FlyingPlayer player) { this.context = context; this.userAgent = userAgent; this.drmCallback = drmCallback; this.player = player; MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser(); manifestDataSource = new DefaultUriDataSource(context, userAgent); manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser); }
public AsyncRendererBuilder(Context context, String userAgent, String url, MediaDrmCallback drmCallback, AudioCapabilities audioCapabilities, DemoPlayer player) { this.context = context; this.userAgent = userAgent; this.drmCallback = drmCallback; this.audioCapabilities = audioCapabilities; this.player = player; MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser(); manifestDataSource = new DefaultUriDataSource(context, userAgent); manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser); }
public AsyncRendererBuilder(Context context, String userAgent, String url, MediaDrmCallback drmCallback, ExoplayerWrapper player) { this.context = context; this.userAgent = userAgent; this.drmCallback = drmCallback; this.player = player; MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser(); manifestDataSource = new DefaultUriDataSource(context, userAgent); manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser); }
SimpleDashParser parse(String localPath) throws IOException { InputStream inputStream = new BufferedInputStream(new FileInputStream(localPath)); MediaPresentationDescriptionParser mpdParser = new MediaPresentationDescriptionParser(); MediaPresentationDescription mpd = mpdParser.parse(localPath, inputStream); if (mpd.getPeriodCount() < 1) { throw new IOException("At least one period is required"); } Period period = mpd.getPeriod(0); List<AdaptationSet> adaptationSets = period.adaptationSets; AdaptationSet videoAdaptation = adaptationSets.get(period.getAdaptationSetIndex(AdaptationSet.TYPE_VIDEO)); List<Representation> representations = videoAdaptation.representations; if (representations == null || representations.isEmpty()) { throw new IOException("At least one video representation is required"); } Representation representation = representations.get(0); format = representation.format; hasContentProtection = videoAdaptation.hasContentProtection(); if (hasContentProtection) { loadDrmInitData(representation); } return this; }
public void build() { MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser(); ManifestFetcher<MediaPresentationDescription> manifestFetcher = new ManifestFetcher<>(manifestUrl, new DefaultHttpDataSource(userAgent, null), parser); manifestFetcher.singleLoad(player.getMainHandler().getLooper(), this); }