Skip to content

Use ExoPlayer instead of MediaPlayer#3240

Merged
ahmedre merged 1 commit intomainfrom
migrate_to_exoplayer
Jun 15, 2025
Merged

Use ExoPlayer instead of MediaPlayer#3240
ahmedre merged 1 commit intomainfrom
migrate_to_exoplayer

Conversation

@ahmedre
Copy link
Copy Markdown
Contributor

@ahmedre ahmedre commented Jun 15, 2025

ExoPlayer is much more resilient and customizable and is the recommended
route today. For Quran specifically, it has improved seeking, which
stops vbr audio seeks from being extremely inaccurate, and stops us from
having to force encode everything as cbr.

It also handles things for us (like audio focus and ducking) resulting
in less code to maintain. Since it is in use for Android Auto also,
there is no additional apk size to pay on top of today's apk size.

ExoPlayer is much more resilient and customizable and is the recommended
route today. For Quran specifically, it has improved seeking, which
stops vbr audio seeks from being extremely inaccurate, and stops us from
having to force encode everything as cbr.

It also handles things for us (like audio focus and ducking) resulting
in less code to maintain. Since it is in use for Android Auto also,
there is no additional apk size to pay on top of today's apk size.
@github-actions
Copy link
Copy Markdown

OLD: app-madani-debug.apk (signature: V1, V2)
NEW: app-madani-debug.apk (signature: V1, V2)

          │           compressed           │          uncompressed          
          ├───────────┬───────────┬────────┼───────────┬───────────┬────────
 APK      │ old       │ new       │ diff   │ old       │ new       │ diff   
──────────┼───────────┼───────────┼────────┼───────────┼───────────┼────────
      dex │  24.8 MiB │  24.8 MiB │ -243 B │  76.2 MiB │  76.2 MiB │ +228 B 
     arsc │     2 MiB │     2 MiB │    0 B │     2 MiB │     2 MiB │    0 B 
 manifest │   5.9 KiB │   5.9 KiB │    0 B │  28.7 KiB │  28.7 KiB │    0 B 
      res │   1.8 MiB │   1.8 MiB │   -2 B │     2 MiB │     2 MiB │    0 B 
   native │  18.8 KiB │  18.8 KiB │    0 B │  36.5 KiB │  36.5 KiB │    0 B 
    asset │ 404.2 KiB │ 404.2 KiB │    0 B │ 678.6 KiB │ 678.6 KiB │    0 B 
    other │ 227.2 KiB │ 227.2 KiB │   -9 B │ 487.4 KiB │ 487.4 KiB │    0 B 
──────────┼───────────┼───────────┼────────┼───────────┼───────────┼────────
    total │  29.2 MiB │  29.2 MiB │ -254 B │  81.4 MiB │  81.4 MiB │ +228 B 

@ahmedre
Copy link
Copy Markdown
Contributor Author

ahmedre commented Jun 15, 2025

Thanks to Claude Code for pairing with me on this one. Got it to start working while thoroughly reviewing the changes and asking it questions and redirecting it along the way. Did manual review and changes, and found and fixed one pretty critical bug, but otherwise all good al7amdulillah.

This was something I wanted to do for quite a while now (I have a draft branch with a proof of concept on this since December 26, 2019). The motivation to finally do it now was that some of the new Qaris have misaligned timings, which, after investigation, made me realize the times are correct but the seeking is incorrect (i.e. on a desktop with an audio player, seeking to the same spot results in better results).

I had two options - migrate these files to be cbr or try ExoPlayer which is better about seeking, so went with the latter. Tested the same scenario and al7amdulillah it's working much better.

@ahmedre ahmedre added this pull request to the merge queue Jun 15, 2025
@nacer80
Copy link
Copy Markdown

nacer80 commented Jun 15, 2025

JazakumAllah khairan

Merged via the queue into main with commit 3ed8555 Jun 15, 2025
2 checks passed
@ahmedre ahmedre deleted the migrate_to_exoplayer branch June 15, 2025 17:43
@sayyid97
Copy link
Copy Markdown

Mashaalloh, Allohumma baarik 👍

@Hamza1244
Copy link
Copy Markdown

@ahmedre Please answer me 4 very good blood Quran I do not know how to send you to add

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants