Amity video upload android error

Given the code below. It uploads well and can track progress but does not jump to COMPLETE, CANCELLED etc. It takes to much time to load

AmityCoreClient.newFileRepository()
.uploadVideo(uri = videoUri, contentFeedType = AmityContentFeedType.POST)
.doOnNext { uploadResult: AmityUploadResult →
when (uploadResult) {
is AmityUploadResult.PROGRESS → {
// upload progress event
val progress = uploadResult.getUploadInfo().getProgressPercentage()
attachment_progress = progress
Log.e(“PROGRESS”, attachment_progress.toString())
}
is AmityUploadResult.COMPLETE → {
// completion event
val video: AmityVideo = uploadResult.getFile()
fileIds.add(video.getFileId())
attachment_type = “video”

                    val postAttachments = mutableListOf<PostAttachment>()
                    for (fileId in fileIds) {
                        val postAttachment = PostAttachment(fileId, "video")
                        postAttachments.add(postAttachment)
                    }

                    postAttachmentAdapter = PostAttachmentAdapter(this@SocialPostCreateActivity, postAttachments)
                    binding.recyclerViewAttachment.adapter = postAttachmentAdapter
                    binding.textViewProgress.text = "Loading .."
                    binding.cardViewProgress.visibility = GONE
                }
                is AmityUploadResult.ERROR -> {
                    // error event
                    val error = AmityError.from(uploadResult.getError())
                    Toast.makeText(this@SocialPostCreateActivity, "Error attaching files", Toast.LENGTH_SHORT).show()
                    binding.textViewProgress.text = "Loading .."
                    binding.cardViewProgress.visibility = GONE
                }
                is AmityUploadResult.CANCELLED -> {
                    // cancelled upload event
                    binding.textViewProgress.text = "Loading .."
                    binding.cardViewProgress.visibility = GONE
                }
            }
        }
        .subscribe()

Hello, the loading time can vary depending on factors such as the video size, internet connection, server region, and the actual application location.

Could you please provide information about the video size? When you mentioned that it never jumps to complete or is cancelled, did you mean that it remains stuck in an infinite loading loop and never completes?

Hello Yes. When you track progress it gets to 99 and never goes to completed. Any video size even less than 1MB. Suprisingly the image and files work perfectly even if 5MB. Internet speed is not an issue

1 Like

@tkmovement Let me pass this on to my team for further checking, and I’ll get back to you.

@tkmovement Additional Question : Which version are you using to implement this?

This here on your documentation

NOTE: It was working before. Just started failing this week

@tkmovement Which version of the Android SDK are you using?

com.github.AmityCo.Amity-Social-Cloud-SDK-Android:amity-sdk

Version 6.30.0

@tkmovement Thank you for the information you provided. I will get back to you if there are any updates.

Hello @tkmovement , I have sent an email to tkmovement.dev@gmail.com requesting additional information.

Thank you,