我已成功使用exoplayer播放hls
文件,但需要播放DASH文件的示例。请给我样品或概述。所以能够发挥它。提前谢谢
答案 0 :(得分:0)
DataSource videoDataSource =
new DefaultUriDataSource(context, bandwidthMeter, userAgent);
ChunkSource videoChunkSource = new DashChunkSource(manifestFetcher,
DefaultDashTrackSelector.newVideoInstance(context, true, filterHdContent),
videoDataSource, new FormatEvaluator.AdaptiveEvaluator(bandwidthMeter), LIVE_EDGE_LATENCY_MS,
elapsedRealtimeOffset, mainHandler, (DashChunkSource.EventListener) player, VideoPlayer.TYPE_VIDEO);
ChunkSampleSource videoSampleSource =
new ChunkSampleSource(videoChunkSource, loadControl,
MAIN_BUFFER_SEGMENTS * BUFFER_SEGMENT_SIZE, mainHandler, player,
VideoPlayer.TYPE_VIDEO);
TrackRenderer videoRenderer =
new MediaCodecVideoTrackRenderer(context, videoSampleSource,
MediaCodecSelector.DEFAULT, MediaCodec.VIDEO_SCALING_MODE_SCALE_TO_FIT,
5000,
drmSessionManager, true, mainHandler, player, 50);