Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add first frame video support for comment videos #1428

Merged
merged 1 commit into from Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions app/build.gradle.kts
Expand Up @@ -138,6 +138,7 @@ dependencies {
implementation("io.coil-kt:coil-compose:2.6.0")
implementation("io.coil-kt:coil-gif:2.6.0")
implementation("io.coil-kt:coil-svg:2.6.0")
implementation("io.coil-kt:coil-video:2.6.0")
// Allows for proper subsampling of large images
implementation("me.saket.telephoto:zoomable-image-coil:0.8.0")
// Animated dropdowns
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/com/jerboa/JerboaApplication.kt
Expand Up @@ -7,6 +7,7 @@ import coil.ImageLoaderFactory
import coil.decode.GifDecoder
import coil.decode.ImageDecoderDecoder
import coil.decode.SvgDecoder
import coil.decode.VideoFrameDecoder
import com.jerboa.api.API
import com.jerboa.db.AppDBContainer
import com.jerboa.util.downloadprogress.DownloadProgress
Expand All @@ -29,12 +30,14 @@ class JerboaApplication : Application(), ImageLoaderFactory {
.placeholder(R.drawable.ic_launcher_foreground)
.components {
add(SvgDecoder.Factory())
add(VideoFrameDecoder.Factory())
}
.build()

imageGifLoader =
imageLoader.newBuilder()
.components {
add(SvgDecoder.Factory())
if (Build.VERSION.SDK_INT >= 28) {
add(ImageDecoderDecoder.Factory())
} else {
Expand Down
Expand Up @@ -21,6 +21,7 @@ import com.jerboa.loginFirstToast
import com.jerboa.model.AccountViewModel
import com.jerboa.model.SiteViewModel
import com.jerboa.toEnum
import com.jerboa.ui.components.common.apiErrorToast
import it.vercruysse.lemmyapi.exception.LemmyBadRequestException
import it.vercruysse.lemmyapi.v0x19.LemmyApi
import it.vercruysse.lemmyapi.v0x19.datatypes.GetPersonDetails
Expand Down Expand Up @@ -427,8 +428,11 @@ suspend fun Account.isReadyAndIfNotDisplayInfo(
}

AccountVerificationState.JWT_VERIFIED to CheckState.Failed -> {
accountVM.deleteAccountAndSwapCurrent(this, swapToAnon = true).invokeOnCompletion {
accountVM.deleteAccountAndSwapCurrent(this, swapToAnon = true).invokeOnCompletion { err ->
appState.toLogin()
if (err != null) {
apiErrorToast(ctx, err)
}
}
}

Expand Down