aliucord-plugins icon indicating copy to clipboard operation
aliucord-plugins copied to clipboard

feat: improve AudioPlayer

Open Halkiion opened this issue 7 months ago • 5 comments

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.

Halkiion avatar May 22 '25 21:05 Halkiion

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

Halkiion avatar May 23 '25 17:05 Halkiion

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.

wseemann/FFmpegMediaMetadataRetriever

This contians a native library and isn't usable in plugins.

rushiiMachine avatar May 23 '25 19:05 rushiiMachine

Could you resolve the review discussions if you've addressed them?

rushiiMachine avatar May 30 '25 04:05 rushiiMachine

Could you resolve the review discussions if you've addressed them?

done

Halkiion avatar May 30 '25 04:05 Halkiion

any update?

Halkiion avatar Jun 02 '25 17:06 Halkiion