mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Allow to record a voice message (#1926)
This commit is contained in:
@@ -16,9 +16,26 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
enum VoiceMessageCacheError: Error {
|
||||
case invalidFileExtension
|
||||
case failedStoringFileInCache
|
||||
}
|
||||
|
||||
protocol VoiceMessageCacheProtocol {
|
||||
/// Returns the URL of the cached audio file for a given media source
|
||||
/// - Parameter mediaSource: the media source
|
||||
/// - Returns: the URL of the cached audio file or nil if the file doesn't exist
|
||||
func fileURL(for mediaSource: MediaSourceProxy) -> URL?
|
||||
func cache(mediaSource: MediaSourceProxy, using fileURL: URL, move: Bool) throws -> URL
|
||||
|
||||
/// Adds a file in the cache
|
||||
/// - Parameters:
|
||||
/// - mediaSource: the media source
|
||||
/// - fileURL: the source file
|
||||
/// - move: wheter to move or copy the source file
|
||||
/// - Returns: the cached URL
|
||||
func cache(mediaSource: MediaSourceProxy, using fileURL: URL, move: Bool) -> Result<URL, VoiceMessageCacheError>
|
||||
|
||||
/// Clears the cache
|
||||
func clearCache()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user