Android ExoPlayer无法在运行Android 6.0.1的华硕Zenfone 2上播放

时间:2018-02-02 11:28:30

标签: android exoplayer

我的视频播放器没有在运行Android Marshmallow的华硕Zenfone 2上播放。我不知道缓存库或ExoPlayer是否存在问题。

我的代码如下 -

BandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();
TrackSelection.Factory videoTrackSelectionFactory = new AdaptiveTrackSelection.Factory(bandwidthMeter);
TrackSelector trackSelector = new DefaultTrackSelectorvideoTrackSelectionFactory);
exoPlayer = ExoPlayerFactory.newSimpleInstance(this, trackSelector);
mBetterVideoPlayer.setKeepScreenOn(true);
mBetterVideoPlayer.setPlayer(exoPlayer);
mBetterVideoPlayer.setResizeMode(AspectRatioFrameLayout.RESIZE_MODE_ZOOM);
HttpProxyCacheServer proxy = AppBaseApplication.getProxy(NewWorkoutVideoActivity.this);
proxy.registerCacheListener(NewWorkoutVideoActivity.this, current.getVideo());
proxyUrl = proxy.getProxyUrl(current.getVideo());
DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(getApplicationContext(),Util.getUserAgent(this, "yourApplicationName"));
MediaSource videoSource = new ExtractorMediaSource.Factory(dataSourceFactory).createMediaSource(Uri.parse(proxyUrl));
exoPlayer.prepare(videoSource);

0 个答案:

没有答案