Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ios/Video/VideoMain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class VideoCompressor {
}

func compress(fileUrl: String, options: [String: Any], resolve:@escaping RCTPromiseResolveBlock, reject:@escaping RCTPromiseRejectBlock) -> Void {
let progressDivider=options["progressDivider"] as? Int ?? 0
let progressDivider=(options["progressDivider"] as? NSNumber)?.intValue ?? 0
compressVideo(url: URL(string: fileUrl)!, options:options,
onProgress: { progress in
EventEmitterHandler.emitVideoCompressProgress(progress, uuid: options["uuid"] as! String)
Expand Down Expand Up @@ -266,7 +266,7 @@ class VideoCompressor {
func autoCompressionHelper(url: URL, options: [String: Any], onProgress: @escaping (Float) -> Void, onCompletion: @escaping (URL) -> Void, onFailure: @escaping (Error) -> Void){
let maxSize = (options["maxSize"] as? NSNumber)?.floatValue ?? 640
let uuid:String = options["uuid"] as! String
let progressDivider=options["progressDivider"] as? Int ?? 0
let progressDivider=(options["progressDivider"] as? NSNumber)?.intValue ?? 0
let stripAudio=options["stripAudio"] as? Bool ?? false

let asset = AVAsset(url: url)
Expand All @@ -289,7 +289,7 @@ class VideoCompressor {
func manualCompressionHelper(url: URL, options: [String: Any], onProgress: @escaping (Float) -> Void, onCompletion: @escaping (URL) -> Void, onFailure: @escaping (Error) -> Void){
let uuid:String = options["uuid"] as! String
let bitRate = (options["bitrate"] as? NSNumber)?.intValue
let progressDivider=options["progressDivider"] as? Int ?? 0
let progressDivider=(options["progressDivider"] as? NSNumber)?.intValue ?? 0
let stripAudio=options["stripAudio"] as? Bool ?? false
let asset = AVAsset(url: url)
guard let track = getVideoTrack(asset: asset) else {
Expand Down Expand Up @@ -461,7 +461,7 @@ class VideoCompressor {
static func getAbsoluteVideoPath(_ videoPath: String, options: [String: Any], completionHandler: @escaping (String) -> Void) {
if videoPath.hasPrefix("http://") || videoPath.hasPrefix("https://") {
let uuid=options["uuid"] as? String ?? ""
let progressDivider=options["progressDivider"] as? Int ?? 0
let progressDivider=(options["progressDivider"] as? NSNumber)?.intValue ?? 0
Downloader.downloadFileAndSaveToCache(videoPath, uuid: uuid,progressDivider:progressDivider) { downloadedPath in
completionHandler(downloadedPath)
}
Expand Down
Loading