File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 8
8
9
9
Pod ::Spec . new do |s |
10
10
s . name = 'VideoUploaderIos'
11
- s . version = '0.0.1 '
11
+ s . version = '0.0.2 '
12
12
s . summary = 'A library to upload video files to api.video platform.'
13
13
14
14
# This description is used to generate tags and improve search results.
Original file line number Diff line number Diff line change @@ -8,16 +8,18 @@ public class VideoUploader {
8
8
private var token : String ! = " "
9
9
private var tokenType : String ! = " Bearer "
10
10
11
- private static let DEFAULT_CHUNK_SIZE = 1024 * 1024 * 5 ;
12
- private static let DEFAULT_USER_AGENT = " api.video uploader (ios; v:0.0.1; ) " ;
11
+ private static let MIN_CHUNK_SIZE = 1024 * 1024 * 5 ;
12
+ private static let MAX_CHUNK_SIZE = 1024 * 1024 * 128 ;
13
+ private static let DEFAULT_CHUNK_SIZE = 1024 * 1024 * 50 ;
14
+ private static let DEFAULT_USER_AGENT = " api.video uploader (ios; v:0.0.2; ) " ;
13
15
14
16
public init ( host: String ? = nil , chunkSize: Int ? = nil , userAgent: String ? = nil ) {
15
17
self . host = host ?? " ws.api.video " ;
16
18
self . chunkSize = chunkSize ?? VideoUploader . DEFAULT_CHUNK_SIZE
17
19
self . userAgent = userAgent ?? VideoUploader . DEFAULT_USER_AGENT
18
20
19
- if ( self . chunkSize < VideoUploader . DEFAULT_CHUNK_SIZE ) {
20
- print ( " Given chunk size is below the minimal allowed value . The default value will be used." ) ;
21
+ if ( self . chunkSize < VideoUploader . MIN_CHUNK_SIZE || self . chunkSize > VideoUploader . MAX_CHUNK_SIZE ) {
22
+ print ( " Invalid chunk size value. Must be greater than 5MB bytes and lower than 128MB . The default value (50MB) will be used." ) ;
21
23
self . chunkSize = VideoUploader . DEFAULT_CHUNK_SIZE;
22
24
}
23
25
}
You can’t perform that action at this time.
0 commit comments