google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.66k stars 6k forks source link

None of the available extractors. Error to player a video from .exo files #5762

Closed marcosmagno closed 5 years ago

marcosmagno commented 5 years ago

[REQUIRED] Content description

Error while playing a video from the .exo files. I'm using ExtractorMediaSource. Code: final DataSource.Factory manifestDataSourceFactory = new DefaultHttpDataSourceFactory("device 1"); // App initialization File cacheDirectory = new File(getApplicationContext().getExternalCacheDir(), "downloads"); SimpleCache cache = new SimpleCache(cacheDirectory, new NoOpCacheEvictor()); // Playback CacheDataSourceFactory dataSourceFactory = new CacheDataSourceFactory(cache, manifestDataSourceFactory); ExtractorMediaSource mediaSource = new ExtractorMediaSource.Factory(dataSourceFactory) .createMediaSource(Uri.parse(String.valueOf(uri))); player.prepare(mediaSource); }

[REQUIRED] Link to test content

https://github.com/marcosmagno/exp2.1/blob/master/APP_VideoD2D/App%20Paper%20PIMRC%202019/dashVideoPIMRC2019/app/player-lib/src/main/java/com/example/winet/PlayerActivity.java

[REQUIRED] Version of ExoPlayer being used

2.8.3

[REQUIRED] Device(s) and version(s) of Android being used

Nexus 5X. Android 6

ojw28 commented 5 years ago

As already stated on #4937, .exo files are not meant to be played directly. Neither should they be sent from one device to another. They are cache files intended to remain local to the device that cached them.

If you need to download content and then send it from one device to another, then you'll need to come up with a solution that does not use SimpleCache or rely on .exo files, since this is not a use case these components support. Marking as duplicate of #4937.