@@ -16,43 +16,64 @@ A clear and concise description of what the bug is.
1616
1717``` groovy
1818dependencies {
19- implementation ' io.fastpix.data:media3:1.2.2'
19+ implementation(" io.fastpix.upload:X.X.X")
2020}
2121```
2222
23232 . ** Code To Reproduce**
2424
2525``` kotlin
26- val videoDataDetails = VideoDataDetails (
27- videoId = UUID .randomUUID().toString(),
28- videoTitle = " My Video"
29- ).apply {
30- videoSeries = " Demo Series"
31- videoProducer = " Demo Producer"
32- videoContentType = " VOD"
33- // ..etc
34- }
35- // Optional
36- val playerDataDetails = PlayerDataDetails (
37- playerName = " media3" ,
38- playerVersion = " latest-version"
39- )
40- // Optional
41- val customDataDetails = CustomDataDetails ().apply {
42- customField1 = " Custom Value 1"
43- customField2 = " Custom Value 2"
44- // ..etc
45- }
46-
47- fastPixDataSDK = FastPixBaseMedia3Player (
48- context = this ,
49- playerView = binding.playerView,
50- exoPlayer = exoPlayer,
51- workSpaceId = " workspace-key" ,
52- playerDataDetails = playerDataDetails,
53- videoDataDetails = videoDataDetails,
54- customDataDetails = customDataDetails
55- )
26+ val sdk = FastPixUploadSdk .Builder (this )
27+ .setFile(file)
28+ .setSignedUrl(_signedUrl .orEmpty())
29+ .setChunkSize(16 * 1024 * 1024 ) // Chunk Size in Byte
30+ .setMaxRetries(3 )
31+ .callback(new object : FastPixUploadCallbacks {
32+ override fun onProgressUpdate (progress : Double ) {
33+ /* ... */
34+ }
35+ override fun onPauseUploading () {
36+ // Handle Pause State
37+ }
38+ override fun onResumeUploading () {
39+ // Handle Resume State
40+ }
41+ override fun onAbort () {
42+ // Handle Abort State
43+ }
44+ override fun onUploadInit () {
45+ // Handle Abort State
46+ }
47+ override fun onChunkHanlded (
48+ totalChunks : Int ,
49+ fileSizeInBytes : Long ,
50+ currentChunk : Int ,
51+ currentChunkSizeInBytes : Long
52+ ) {
53+ // Update the UI according chunk data
54+ }
55+ override fun onSuccess (timiMillis : Long ) {
56+ // Time to complete the Upload Process
57+ }
58+ override fun onChunkUploadingFailed (
59+ failedChunkRetries : Int ,
60+ chunkCount : Int ,
61+ chunkSize : Int
62+ ) {
63+ // Handle Chunk Upload Failure
64+ }
65+ override fun onError (error : String , timeMillis : Long ) {
66+ // Handle error message
67+ }
68+ override fun onNetworkStateChanged (isOnline : Boolean ) {
69+ // Handle Network Changes
70+ }
71+
72+ })
73+ .setRetryDelay(2000 ) // Retry Delay
74+ .build()
75+ // Starts the Uploading Process
76+ sdk.startUpload()
5677```
5778
58793 . ** Expected Behavior**
@@ -79,37 +100,57 @@ fastPixDataSDK = FastPixBaseMedia3Player(
79100
80101``` kotlin
81102// Please provide a minimal code sample that reproduces the issue
82- private val fastPixDataSDK = FastPixDataSDK ()
83- val videoDataDetails = VideoDataDetails (
84- videoId = UUID .randomUUID().toString(),
85- videoTitle = " My Video"
86- ).apply {
87- videoSeries = " Demo Series"
88- videoProducer = " Demo Producer"
89- videoContentType = " VOD"
90- // ..etc
91- }
92- // Optional
93- val playerDataDetails = PlayerDataDetails (
94- playerName = " media3" ,
95- playerVersion = " latest-version"
96- )
97- // Optional
98- val customDataDetails = CustomDataDetails ().apply {
99- customField1 = " Custom Value 1"
100- customField2 = " Custom Value 2"
101- // ..etc
102- }
103-
104- fastPixDataSDK = FastPixBaseMedia3Player (
105- context = this ,
106- playerView = binding.playerView,
107- exoPlayer = exoPlayer,
108- workSpaceId = " workspace-key" ,
109- playerDataDetails = playerDataDetails,
110- videoDataDetails = videoDataDetails,
111- customDataDetails = customDataDetails
112- )
103+ val sdk = FastPixUploadSdk .Builder (this )
104+ .setFile(file)
105+ .setSignedUrl(_signedUrl .orEmpty())
106+ .setChunkSize(16 * 1024 * 1024 ) // Chunk Size in Byte
107+ .setMaxRetries(3 )
108+ .callback(new object : FastPixUploadCallbacks {
109+ override fun onProgressUpdate (progress : Double ) {
110+ /* ... */
111+ }
112+ override fun onPauseUploading () {
113+ // Handle Pause State
114+ }
115+ override fun onResumeUploading () {
116+ // Handle Resume State
117+ }
118+ override fun onAbort () {
119+ // Handle Abort State
120+ }
121+ override fun onUploadInit () {
122+ // Handle Abort State
123+ }
124+ override fun onChunkHanlded (
125+ totalChunks : Int ,
126+ fileSizeInBytes : Long ,
127+ currentChunk : Int ,
128+ currentChunkSizeInBytes : Long
129+ ) {
130+ // Update the UI according chunk data
131+ }
132+ override fun onSuccess (timiMillis : Long ) {
133+ // Time to complete the Upload Process
134+ }
135+ override fun onChunkUploadingFailed (
136+ failedChunkRetries : Int ,
137+ chunkCount : Int ,
138+ chunkSize : Int
139+ ) {
140+ // Handle Chunk Upload Failure
141+ }
142+ override fun onError (error : String , timeMillis : Long ) {
143+ // Handle error message
144+ }
145+ override fun onNetworkStateChanged (isOnline : Boolean ) {
146+ // Handle Network Changes
147+ }
148+
149+ })
150+ .setRetryDelay(2000 ) // Retry Delay
151+ .build()
152+ // Starts the Uploading Process
153+ sdk.startUpload()
113154```
114155
115156## Logs/Stack Trace
0 commit comments