Skip to content

Commit

Permalink
🔀 Merge pull request #67 from the-best-is-best/main
Browse files Browse the repository at this point in the history
fix ios pick video use UTTypeMovie for pick video or media in ios
  • Loading branch information
vinceglb authored Jul 18, 2024
2 parents 585361b + d56aa3a commit a4494cc
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import platform.UniformTypeIdentifiers.UTType
import platform.UniformTypeIdentifiers.UTTypeContent
import platform.UniformTypeIdentifiers.UTTypeFolder
import platform.UniformTypeIdentifiers.UTTypeImage
import platform.UniformTypeIdentifiers.UTTypeVideo
import platform.UniformTypeIdentifiers.UTTypeMovie
import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine

Expand Down Expand Up @@ -216,7 +216,7 @@ public actual object FileKit {
result.itemProvider.loadFileRepresentationForTypeIdentifier(
typeIdentifier = when (type) {
is PickerType.Image -> UTTypeImage.identifier
is PickerType.Video -> UTTypeVideo.identifier
is PickerType.Video -> UTTypeMovie.identifier
is PickerType.ImageAndVideo -> UTTypeContent.identifier
else -> throw IllegalArgumentException("Unsupported type: $type")
}
Expand Down Expand Up @@ -260,8 +260,8 @@ public actual object FileKit {
private val PickerType.contentTypes: List<UTType>
get() = when (this) {
is PickerType.Image -> listOf(UTTypeImage)
is PickerType.Video -> listOf(UTTypeVideo)
is PickerType.ImageAndVideo -> listOf(UTTypeImage, UTTypeVideo)
is PickerType.Video -> listOf(UTTypeMovie)
is PickerType.ImageAndVideo -> listOf(UTTypeImage, UTTypeMovie)
is PickerType.File -> extensions
?.mapNotNull { UTType.typeWithFilenameExtension(it) }
.ifNullOrEmpty { listOf(UTTypeContent) }
Expand Down

0 comments on commit a4494cc

Please sign in to comment.