exoplayer 纯java,Exoplayer不播放任何视频
讓Exoplayer工作有問(wèn)題 . 我設(shè)法從網(wǎng)址加載視頻 . 但它只播放音頻 . 所以我做錯(cuò)了什么 .
BandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();
TrackSelection.Factory videoTrackSelectionFactory = new AdaptiveVideoTrackSelection.Factory(bandwidthMeter);
TrackSelector trackSelector = new DefaultTrackSelector(videoTrackSelectionFactory);
LoadControl loadControl = new DefaultLoadControl();
SimpleExoPlayer exoPlayer = ExoPlayerFactory.newSimpleInstance(simpleExoPlayerView.getContext(), trackSelector, loadControl);
Uri mp4VideoUri = Uri.parse(videoUri);
DefaultHttpDataSourceFactory dataSourceFactory = new DefaultHttpDataSourceFactory("ExoPlayerDemo");
ExtractorsFactory extractor = new DefaultExtractorsFactory();
MediaSource videoSource = new ExtractorMediaSource(mp4VideoUri, dataSourceFactory, extractor, null, null);
exoPlayer.prepare(videoSource);
exoPlayer.setPlayWhenReady(true);
這就是我只能播放音頻的方式 . 不知道我應(yīng)該改變什么 .
總結(jié)
以上是生活随笔為你收集整理的exoplayer 纯java,Exoplayer不播放任何视频的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: ajax荷马史诗,荷马史诗(8)
- 下一篇: net framework 3.5 安装