File tree 2 files changed +4
-22
lines changed
feature/upload/src/main/java/com/record/upload
2 files changed +4
-22
lines changed Original file line number Diff line number Diff line change 1
1
package com.record.upload
2
2
3
- import android.content.Context
4
3
import android.util.Base64
5
4
import android.util.Log
6
5
import androidx.lifecycle.viewModelScope
@@ -39,27 +38,19 @@ class UploadViewModel @Inject constructor(
39
38
}
40
39
}
41
40
42
- fun uploadVideoToS3Bucket (context : Context , file : File ) =
41
+ fun uploadVideoToS3Bucket (file : File ) =
43
42
viewModelScope.launch {
44
- Log .d(" testUploadStart" , " $" )
45
- var a = " "
46
- var b = " "
47
43
uploadRepository.uploadVideoToS3Bucket(
48
44
uiState.value.bucketUrl,
49
45
file,
50
- ).onSuccess {
51
- a = removeQueryParameters(it)
52
- Log .d(" testUpload" , " $a " )
46
+ ).onSuccess { videoUrl ->
53
47
uploadRepository.uploadThumbnailToS3Bucket(
54
48
uiState.value.thumbnailUrl,
55
49
file,
56
- ).onSuccess {
57
- b = removeQueryParameters(it)
58
- Log .d(" testUploadthumbnailUrl" , " $b " )
59
- uploadRecord(a, b)
50
+ ).onSuccess { thumbNailUrl ->
51
+ uploadRecord(videoUrl, thumbNailUrl)
60
52
}
61
53
}.onFailure {
62
- Log .d(" testUploadFail" , " $b " )
63
54
}
64
55
}
65
56
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ package com.record.upload.extension
2
2
3
3
import android.content.ContentUris
4
4
import android.content.Context
5
- import android.graphics.Bitmap
6
5
import android.media.MediaMetadataRetriever
7
6
import android.net.Uri
8
7
import android.provider.MediaStore
@@ -16,13 +15,6 @@ import com.abedelazizshe.lightcompressorlibrary.config.SharedStorageConfiguratio
16
15
import kotlinx.coroutines.CoroutineScope
17
16
import kotlinx.coroutines.Dispatchers
18
17
import kotlinx.coroutines.launch
19
- import okhttp3.MediaType.Companion.toMediaTypeOrNull
20
- import okhttp3.OkHttpClient
21
- import okhttp3.Request
22
- import okhttp3.RequestBody
23
- import java.io.File
24
- import java.io.FileOutputStream
25
- import java.io.IOException
26
18
27
19
fun getAllVideos (
28
20
loadSize : Int ,
@@ -166,4 +158,3 @@ fun formatDuration(durationMillis: Long): String {
166
158
val seconds = (durationMillis / 1000 ) % 60
167
159
return String .format(" %d:%02d" , minutes, seconds)
168
160
}
169
-
You can’t perform that action at this time.
0 commit comments