Fix detection of DASH .mpd extension. Update support in README.

This commit is contained in:
Ryan Heise 2020-08-07 14:07:07 +10:00
parent 122a90b4fb
commit 6c869b01ab
2 changed files with 20 additions and 20 deletions

View File

@ -4,25 +4,25 @@ A Flutter plugin to play audio from URLs, files, assets, DASH/HLS streams and pl
## Features ## Features
| Feature | Android | iOS | MacOS | Web | | Feature | Android | iOS | MacOS | Web |
| ------- | :-------: | :-----: | :-----: | :-----: | | ------- | :-------: | :-----: | :-----: | :-----: |
| read from URL | ✅ | ✅ | ✅ | ✅ | | read from URL | ✅ | ✅ | ✅ | ✅ |
| read from file | ✅ | ✅ | ✅ | | | read from file | ✅ | ✅ | ✅ | |
| read from asset | ✅ | ✅ | ✅ | | | read from asset | ✅ | ✅ | ✅ | |
| request headers | ✅ | ✅ | ✅ | | | request headers | ✅ | ✅ | ✅ | |
| DASH | ✅ | (untested) | (untested) | (untested) | | DASH | ✅ | | | |
| HLS | ✅ | ✅ | (untested) | (untested) | | HLS | ✅ | ✅ | ✅ | |
| buffer status/position | ✅ | ✅ | ✅ | ✅ | | buffer status/position | ✅ | ✅ | ✅ | ✅ |
| play/pause/seek | ✅ | ✅ | ✅ | ✅ | | play/pause/seek | ✅ | ✅ | ✅ | ✅ |
| set volume | ✅ | ✅ | ✅ | ✅ | | set volume | ✅ | ✅ | ✅ | ✅ |
| set speed | ✅ | ✅ | ✅ | ✅ | | set speed | ✅ | ✅ | ✅ | ✅ |
| clip audio | ✅ | ✅ | ✅ | ✅ | | clip audio | ✅ | ✅ | ✅ | ✅ |
| playlists | ✅ | ✅ | ✅ | ✅ | | playlists | ✅ | ✅ | ✅ | ✅ |
| looping | ✅ | ✅ | ✅ | ✅ | | looping | ✅ | ✅ | ✅ | ✅ |
| shuffle | ✅ | ✅ | ✅ | ✅ | | shuffle | ✅ | ✅ | ✅ | ✅ |
| compose audio | ✅ | ✅ | ✅ | ✅ | | compose audio | ✅ | ✅ | ✅ | ✅ |
| gapless playback | ✅ | ✅ | ✅ | | | gapless playback | ✅ | ✅ | ✅ | |
| report player errors | ✅ | ✅ | ✅ | ✅ | | report player errors | ✅ | ✅ | ✅ | ✅ |
Please consider reporting any bugs you encounter [here](https://github.com/ryanheise/just_audio/issues) or submitting pull requests [here](https://github.com/ryanheise/just_audio/pulls). Please consider reporting any bugs you encounter [here](https://github.com/ryanheise/just_audio/issues) or submitting pull requests [here](https://github.com/ryanheise/just_audio/pulls).

View File

@ -896,7 +896,7 @@ abstract class AudioSource {
bool hasExtension(Uri uri, String extension) => bool hasExtension(Uri uri, String extension) =>
uri.path.toLowerCase().endsWith('.$extension') || uri.path.toLowerCase().endsWith('.$extension') ||
uri.fragment.toLowerCase().endsWith('.$extension'); uri.fragment.toLowerCase().endsWith('.$extension');
if (hasExtension(uri, 'mdp')) { if (hasExtension(uri, 'mpd')) {
return DashAudioSource(uri, headers: headers, tag: tag); return DashAudioSource(uri, headers: headers, tag: tag);
} else if (hasExtension(uri, 'm3u8')) { } else if (hasExtension(uri, 'm3u8')) {
return HlsAudioSource(uri, headers: headers, tag: tag); return HlsAudioSource(uri, headers: headers, tag: tag);