Exoplayer / Android Media Player无法播放带有AC3音频的视频

时间:2019-06-10 12:23:17

标签: android audio video android-mediaplayer exoplayer2.x

我正在使用Exoplayer版本2播放来自内部存储器的视频,它可以正常工作,但是只要视频包含ac3类型的音频,exoplayer就不会播放音频,而只会显示视频。 请帮助我

DefaultBandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();
TrackSelection.Factory videoTrackSelectionFactory = new AdaptiveTrackSelection.Factory(bandwidthMeter);
trackSelector = new DefaultTrackSelector(videoTrackSelectionFactory);

player = ExoPlayerFactory.newSimpleInstance(this, trackSelector);

dataSourceFactory = new DefaultDataSourceFactory(this, Util.getUserAgent(this, "exoplayer2example"), bandwidthMeter);
ExtractorsFactory extractorsFactory = new DefaultExtractorsFactory().setConstantBitrateSeekingEnabled(true);
videoSource = new ExtractorMediaSource(uri, dataSourceFactory, extractorsFactory, null, null);
player.prepare(videoSource);

Android Media Player也会发生相同的问题

0 个答案:

没有答案