// // BFVideoThumbProgressStrategy.swift // BFRecordScreenKit // // Created by 胡志强 on 2021/12/6. // import Foundation import AVFoundation protocol BFVideoThumbProgressStrategyProtocol { // 根据视频时长获取需要的缩略图数量 func frameNumberOfVideo(assetDuration: Double) -> Int } class BFVideoThumbProgressStrategy : BFVideoThumbProgressStrategyProtocol { func frameNumberOfVideo(assetDuration: Double) -> Int { var count = -1 if assetDuration > 0 && assetDuration <= 10 { count = 5 }else if assetDuration >= 10 && assetDuration < 60 { count = 10 }else if assetDuration >= 60 && assetDuration < 300 { count = 20 }else if assetDuration >= 300{ count = 30 } return count } }