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

Fix saving webm videos #1429

Merged
merged 2 commits into from
Mar 8, 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
4 changes: 2 additions & 2 deletions app/src/main/java/com/jerboa/Utils.kt
Expand Up @@ -812,7 +812,7 @@ enum class PostType {
return when (this) {
Image -> Environment.DIRECTORY_PICTURES
Video -> Environment.DIRECTORY_MOVIES
Link -> Environment.DIRECTORY_DOCUMENTS
Link -> Environment.DIRECTORY_DOWNLOADS
}
}
}
Expand Down Expand Up @@ -1453,7 +1453,7 @@ fun Context.getInputStream(url: String): InputStream {

val videoRgx =
Regex(
pattern = "(http)?s?:?(//[^\"']*\\.(?:mp4|mp3|ogg|flv|m4a|3gp|mkv|mpeg|mov))",
pattern = "(http)?s?:?(//[^\"']*\\.(?:mp4|mp3|ogg|flv|m4a|3gp|mkv|mpeg|mov|webm))",
)

fun isVideo(url: String): Boolean {
Expand Down
Expand Up @@ -251,7 +251,7 @@ fun ViewerHeader(
IconButton(
// TODO disable once it is busy
onClick = {
storeMedia(appState.coroutineScope, ctx, url, PostType.Image)
storeMedia(appState.coroutineScope, ctx, url, PostType.fromURL(url))
},
) {
Icon(
Expand Down