feat: improve AudioPlayer
Fixed several bugs such as:
- Wrong audio playing
- Crashing when switching guild or channel whilst audio is playing
- Audio being unplayable
- .ogg files not showing length or time elapsed.
Improvements
- Accidental taps outside of seek bar when seeking no longer opens the file in the browser as it is blocked.
- Added loading bar so the user cannot press play before the audio is initalised.
Upon doing some research, it appears that downloading the ogg file is necessary for retrieving metadata such as length using MediaMetadataRetriever. I believe having the length for ogg files is important as several users would like to use this plugin for voice messages, which are uploaded as ogg files. Would it be ok if I continue downloading the file before the user presses play so long as I implement this feature and some more cleanup logic for deleting the file once it is no longer necessary?
Alternatively, I have found a library that may offer a solution, but it may be a little too heavy in my opinion: https://github.com/wseemann/FFmpegMediaMetadataRetriever
Would it be ok if I continue downloading the file before the user presses play
No. Duration is not that important. You can cache the file after the user presses play, at which point the duration can be populated in UI.
This contians a native library and isn't usable in plugins.
Could you resolve the review discussions if you've addressed them?
Could you resolve the review discussions if you've addressed them?
done
any update?