我正在做媒体播放器,我的网址是.m3u8。我想在simpleexoplayer中玩,但不工作 其他没有扩展名m3u8的网址也可以正常工作。
请帮助我
DefaultRenderersFactory renderersFactory = new DefaultRenderersFactory(
this,
null,
DefaultRenderersFactory.EXTENSION_RENDERER_MODE_OFF);
TrackSelector trackSelector = new DefaultTrackSelector();
simpleExoPlayer = ExoPlayerFactory.newSimpleInstance(
renderersFactory,
trackSelector);
String userAgent = Util.getUserAgent(this, "Play Audio");
ExtractorMediaSource mediaSource = new ExtractorMediaSource(
Uri.parse(url), // file audio ada di folder assets
new DefaultDataSourceFactory(this, userAgent),
new DefaultExtractorsFactory(),
null,
null);
simpleExoPlayer.prepare(mediaSource);
simpleExoPlayer.setPlayWhenReady(true);