import Foundation /// 录制引擎工厂 public struct RecorderFactory { /// 创建适合当前平台的录制引擎 /// - Returns: macOS 返回 FFmpegRecorder,iOS 返回 AVFoundationRecorder public static func createRecorder() -> StreamRecorderEngine { #if os(macOS) return FFmpegRecorder() #elseif os(iOS) return AVFoundationRecorder() #else fatalError("不支持的平台") #endif } /// 获取当前平台信息 public static var platformInfo: String { #if os(macOS) return "macOS (FFmpeg)" #elseif os(iOS) return "iOS (AVFoundation)" #else return "Unknown" #endif } }