java.lang.IllegalStateException:另一个 SimpleCache 实例使用以下文件夹:
我有这个错误“ java.lang.IllegalStateException:另一个SimpleCache实例使用文件夹:”我正在使用SimpleExoPlayer,当我尝试第二次打开视频时,这个错误显示如何关闭或删除以前的simplecache?这是我的代码:
SimpleExoPlayerView simpleExoPlayerView = findViewById(R.id.video_view);
SimpleExoPlayer player = ExoPlayerFactory.newSimpleInstance(this, new DefaultTrackSelector(new DefaultBandwidthMeter.Builder().build()));
SimpleCache downloadCache = new SimpleCache(new File(getCacheDir(), "exoCache"), new NoOpCacheEvictor());
String uri = "http://dash.akamaized.net/akamai/bbb/bbb_1280x720_60fps_6000k.mp4";
DataSource.Factory dataSourceFactory = new CacheDataSourceFactory(downloadCache, new DefaultDataSourceFactory(this, "seyed"));
MediaSource mediaSource = new ExtractorMediaSource.Factory(dataSourceFactory).createMediaSource(Uri.parse(uri));
player.prepare(mediaSource);
simpleExoPlayerView.setPlayer(player);
player.setPlayWhenReady(true);