-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
Description
DefaultDataSource uses ContentDataSource to open urls. But ContentDataSource.open not following android documentations exactly and cause issues when opening url's in "r" mode only.
You can read ContentProvider.openFile documentation:
* If opened with the exclusive "r" or "w" modes, the returned
* ParcelFileDescriptor can be a pipe or socket pair to enable streaming
* of data. Opening with the "rw" or "rwt" modes implies a file on disk that
* supports seeking.
Since ContentDataSource uses "r" mode, ContentProvider may return Pipe instead of file and resulting bytes (total content length) will be miss detected:
bytesRemaining = inputStream.available();
Problem is, if ContentProvider retuns Pipe, ExoPlayer will stop playing audio after few seconds after fist seek action and close pipe before it fully readed. To fix this we may use open "rw" mode or wait until we reach EOF.
Reactions are currently unavailable