9901376d38
Currently, ExoPlayer is initialized explicitly in `ViewMediaFragment` with all its dependencies, including many that are not useful for viewing Mastodon media attachments. This pull request moves most ExoPlayer initialization and configuration to a new Dagger module, and instead a `Provider<ExoPlayer>` factory is injected in the Fragment so it can create new instances when needed. The following ExoPlayer components will be configured: - **Renderers**: all of them (audio, video, metadata, subtitles) except for the `CameraMotionRenderer`. - **Extractors**: FLAC, Wav, Mp4, Ogg, Matroska/WebM and MP3 containers, to provide the same support as Firefox or Chrome browsers. Other container formats that are either image formats (already covered by Glide), not web-friendly or reserved for live streaming are skipped. - **MediaSource**: only progressive download (through OkHttp) is provided. Live streaming support using protocols like RTSP, MPEG/Dash or HLS is skipped, because Mastodon servers don't use these protocols to download attachments. The Mastodon documentation mentions the [supported media formats for attachments](https://docs.joinmastodon.org/user/posting/#media) and this covers them and even more. The docs also mentions that the video and audio files are transcoded to MP4 and MP3 upon upload but that was not the case in the past (for example WebM was used) and it could change again in the future. Specifying these components manually allows reducing the APK size by about 200 KB thanks to R8 shrinking. There are also a few extra code changes: - Remove the code specific to API < 24 since the min SDK of the app is now 24. - Add support for pausing a video when unplugging headphones. - Specify the audio attributes according to content type to help the Android audio mixer.
153 lines
10 KiB
TOML
153 lines
10 KiB
TOML
[versions]
|
|
agp = "8.3.0"
|
|
androidx-activity = "1.8.2"
|
|
androidx-appcompat = "1.6.1"
|
|
androidx-browser = "1.7.0"
|
|
androidx-cardview = "1.0.0"
|
|
androidx-constraintlayout = "2.1.4"
|
|
androidx-core = "1.12.0"
|
|
androidx-exifinterface = "1.3.7"
|
|
androidx-fragment = "1.6.2"
|
|
androidx-junit = "1.1.5"
|
|
androidx-lifecycle = "2.7.0"
|
|
androidx-media3 = "1.2.1"
|
|
androidx-paging = "3.2.1"
|
|
androidx-preference = "1.2.1"
|
|
androidx-recyclerview = "1.3.0"
|
|
androidx-sharetarget = "1.2.0"
|
|
androidx-splashscreen = "1.0.1"
|
|
androidx-swiperefresh-layout = "1.1.0"
|
|
androidx-testing = "2.2.0"
|
|
androidx-viewpager2 = "1.0.0"
|
|
androidx-work = "2.9.0"
|
|
androidx-room = "2.6.1"
|
|
bouncycastle = "1.70"
|
|
conscrypt = "2.5.2"
|
|
coroutines = "1.8.0"
|
|
dagger = "2.51"
|
|
diffx = "1.1.1"
|
|
emoji2 = "1.4.0"
|
|
espresso = "3.5.1"
|
|
filemoji-compat = "3.2.7"
|
|
glide = "4.16.0"
|
|
# Deliberate downgrade, https://github.com/tuskyapp/Tusky/issues/3631
|
|
glide-animation-plugin = "2.23.0"
|
|
gson = "2.10.1"
|
|
kotlin = "1.9.22"
|
|
image-cropper = "4.3.2"
|
|
material = "1.11.0"
|
|
material-drawer = "8.4.5"
|
|
material-typeface = "4.0.0.2-kotlin"
|
|
mockito-inline = "5.2.0"
|
|
mockito-kotlin = "5.2.1"
|
|
networkresult-calladapter = "1.1.0"
|
|
okhttp = "4.12.0"
|
|
retrofit = "2.9.0"
|
|
robolectric = "4.11.1"
|
|
sparkbutton = "4.2.0"
|
|
touchimageview = "3.6"
|
|
truth = "1.4.2"
|
|
turbine = "1.0.0"
|
|
unified-push = "2.4.0"
|
|
xmlwriter = "1.0.4"
|
|
|
|
[plugins]
|
|
android-application = { id = "com.android.application", version.ref = "agp" }
|
|
google-ksp = "com.google.devtools.ksp:1.9.22-1.0.18"
|
|
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
|
|
kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" }
|
|
kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
|
|
ktlint = "org.jlleitschuh.gradle.ktlint:12.1.0"
|
|
|
|
[libraries]
|
|
android-material = { module = "com.google.android.material:material", version.ref = "material" }
|
|
androidx-activity = { module = "androidx.activity:activity-ktx", version.ref = "androidx-activity" }
|
|
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" }
|
|
androidx-browser = { module = "androidx.browser:browser", version.ref = "androidx-browser" }
|
|
androidx-cardview = { module = "androidx.cardview:cardview", version.ref = "androidx-cardview" }
|
|
androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "androidx-constraintlayout" }
|
|
androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidx-core" }
|
|
androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "androidx-splashscreen" }
|
|
androidx-core-testing = { module = "androidx.arch.core:core-testing", version.ref = "androidx-testing" }
|
|
androidx-emoji2-core = { module = "androidx.emoji2:emoji2", version.ref = "emoji2" }
|
|
androidx-emoji2-views-core = { module = "androidx.emoji2:emoji2-views", version.ref = "emoji2" }
|
|
androidx-emoji2-view-helper = { module = "androidx.emoji2:emoji2-views-helper", version.ref = "emoji2" }
|
|
androidx-exifinterface = { module = "androidx.exifinterface:exifinterface", version.ref = "androidx-exifinterface" }
|
|
androidx-fragment-ktx = { module = "androidx.fragment:fragment-ktx", version.ref = "androidx-fragment" }
|
|
androidx-lifecycle-common-java8 = { module = "androidx.lifecycle:lifecycle-common-java8", version.ref = "androidx-lifecycle" }
|
|
androidx-lifecycle-livedata-ktx = { module = "androidx.lifecycle:lifecycle-livedata-ktx", version.ref = "androidx-lifecycle" }
|
|
androidx-lifecycle-reactivestreams-ktx = { module = "androidx.lifecycle:lifecycle-reactivestreams-ktx", version.ref = "androidx-lifecycle" }
|
|
androidx-lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle" }
|
|
androidx-media3-exoplayer = { module = "androidx.media3:media3-exoplayer", version.ref = "androidx-media3" }
|
|
androidx-media3-datasource-okhttp = { module = "androidx.media3:media3-datasource-okhttp", version.ref = "androidx-media3" }
|
|
androidx-media3-ui = { module = "androidx.media3:media3-ui", version.ref = "androidx-media3" }
|
|
androidx-paging-runtime-ktx = { module = "androidx.paging:paging-runtime-ktx", version.ref = "androidx-paging" }
|
|
androidx-preference-ktx = { module = "androidx.preference:preference-ktx", version.ref = "androidx-preference" }
|
|
androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "androidx-room" }
|
|
androidx-room-paging = { module = "androidx.room:room-paging", version.ref = "androidx-room" }
|
|
androidx-room-ktx = { module = "androidx.room:room-ktx", version.ref = "androidx-room" }
|
|
androidx-room-testing = { module = "androidx.room:room-testing", version.ref = "androidx-room" }
|
|
androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "androidx-recyclerview" }
|
|
androidx-sharetarget = { module = "androidx.sharetarget:sharetarget", version.ref = "androidx-sharetarget" }
|
|
androidx-swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version.ref = "androidx-swiperefresh-layout" }
|
|
androidx-test-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-junit" }
|
|
androidx-viewpager2 = { module = "androidx.viewpager2:viewpager2", version.ref = "androidx-viewpager2" }
|
|
androidx-work-runtime-ktx = { module = "androidx.work:work-runtime-ktx", version.ref = "androidx-work" }
|
|
androidx-work-testing = { module = "androidx.work:work-testing", version.ref = "androidx-work" }
|
|
bouncycastle = { module = "org.bouncycastle:bcprov-jdk15on", version.ref = "bouncycastle" }
|
|
conscrypt-android = { module = "org.conscrypt:conscrypt-android", version.ref = "conscrypt" }
|
|
dagger-android-core = { module = "com.google.dagger:dagger-android", version.ref = "dagger" }
|
|
dagger-android-processor = { module = "com.google.dagger:dagger-android-processor", version.ref = "dagger" }
|
|
dagger-android-support = { module = "com.google.dagger:dagger-android-support", version.ref = "dagger" }
|
|
dagger-compiler = { module = "com.google.dagger:dagger-compiler", version.ref = "dagger" }
|
|
dagger-core = { module = "com.google.dagger:dagger", version.ref = "dagger" }
|
|
diffx = { module = "org.pageseeder.diffx:pso-diffx", version.ref = "diffx" }
|
|
espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espresso" }
|
|
filemojicompat-core = { module = "de.c1710:filemojicompat", version.ref = "filemoji-compat" }
|
|
filemojicompat-defaults = { module = "de.c1710:filemojicompat-defaults", version.ref = "filemoji-compat" }
|
|
filemojicompat-ui = { module = "de.c1710:filemojicompat-ui", version.ref = "filemoji-compat" }
|
|
glide-animation-plugin = { module = "com.github.penfeizhou.android.animation:glide-plugin", version.ref = "glide-animation-plugin" }
|
|
glide-compiler = { module = "com.github.bumptech.glide:ksp", version.ref = "glide" }
|
|
glide-core = { module = "com.github.bumptech.glide:glide", version.ref = "glide" }
|
|
glide-okhttp3-integration = { module = "com.github.bumptech.glide:okhttp3-integration", version.ref = "glide" }
|
|
gson = { module = "com.google.code.gson:gson", version.ref = "gson" }
|
|
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" }
|
|
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
|
|
image-cropper = { module = "com.github.CanHub:Android-Image-Cropper", version.ref = "image-cropper" }
|
|
material-drawer-core = { module = "com.mikepenz:materialdrawer", version.ref = "material-drawer" }
|
|
material-drawer-iconics = { module = "com.mikepenz:materialdrawer-iconics", version.ref = "material-drawer" }
|
|
material-typeface = { module = "com.mikepenz:google-material-typeface", version.ref = "material-typeface" }
|
|
mockito-kotlin = { module = "org.mockito.kotlin:mockito-kotlin", version.ref = "mockito-kotlin" }
|
|
mockito-inline = { module = "org.mockito:mockito-inline", version.ref = "mockito-inline" }
|
|
mockwebserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "okhttp" }
|
|
networkresult-calladapter = { module = "at.connyduck:networkresult-calladapter", version.ref = "networkresult-calladapter" }
|
|
okhttp-core = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
|
|
okhttp-logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" }
|
|
retrofit-converter-gson = { module = "com.squareup.retrofit2:converter-gson", version.ref = "retrofit" }
|
|
retrofit-core = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }
|
|
robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" }
|
|
sparkbutton = { module = "at.connyduck.sparkbutton:sparkbutton", version.ref = "sparkbutton" }
|
|
touchimageview = { module = "com.github.MikeOrtiz:TouchImageView", version.ref = "touchimageview" }
|
|
truth = { module = "com.google.truth:truth", version.ref = "truth" }
|
|
turbine = { module = "app.cash.turbine:turbine", version.ref = "turbine" }
|
|
unified-push = { module = "com.github.UnifiedPush:android-connector", version.ref = "unified-push" }
|
|
xmlwriter = { module = "org.pageseeder.xmlwriter:pso-xmlwriter", version.ref = "xmlwriter" }
|
|
|
|
[bundles]
|
|
androidx = ["androidx-core-ktx", "androidx-appcompat", "androidx-fragment-ktx", "androidx-browser", "androidx-swiperefreshlayout",
|
|
"androidx-recyclerview", "androidx-exifinterface", "androidx-cardview", "androidx-preference-ktx", "androidx-sharetarget",
|
|
"androidx-emoji2-core", "androidx-emoji2-views-core", "androidx-emoji2-view-helper", "androidx-lifecycle-viewmodel-ktx",
|
|
"androidx-lifecycle-livedata-ktx", "androidx-lifecycle-common-java8", "androidx-lifecycle-reactivestreams-ktx",
|
|
"androidx-constraintlayout", "androidx-paging-runtime-ktx", "androidx-viewpager2", "androidx-work-runtime-ktx",
|
|
"androidx-core-splashscreen", "androidx-activity", "androidx-media3-exoplayer", "androidx-media3-datasource-okhttp",
|
|
"androidx-media3-ui"]
|
|
dagger = ["dagger-core", "dagger-android-core", "dagger-android-support"]
|
|
dagger-processors = ["dagger-compiler", "dagger-android-processor"]
|
|
filemojicompat = ["filemojicompat-core", "filemojicompat-ui", "filemojicompat-defaults"]
|
|
glide = ["glide-core", "glide-okhttp3-integration", "glide-animation-plugin"]
|
|
material-drawer = ["material-drawer-core", "material-drawer-iconics"]
|
|
mockito = ["mockito-kotlin", "mockito-inline"]
|
|
okhttp = ["okhttp-core", "okhttp-logging-interceptor"]
|
|
retrofit = ["retrofit-core", "retrofit-converter-gson"]
|
|
room = ["androidx-room-ktx", "androidx-room-paging"]
|
|
xmldiff = ["diffx", "xmlwriter"]
|