added ios module

This commit is contained in:
2026-08-17 20:13:28 +08:00
parent a8031e2e3b
commit 7c81976b2b
27 changed files with 2767 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
import Foundation
enum PlaybackState: String {
case idle
case buffering
case ready
case ended
}
struct PlaybackSnapshot: Equatable {
var mediaId: String?
var positionMs: Int64 = 0
var durationMs: Int64 = -1
var bufferedPositionMs: Int64 = 0
var isPlaying = false
var state: PlaybackState = .idle
var speed: Float = 1
var sentenceIndex: Int?
}
struct PlayerConfig {
var sentenceMode = true
var defaultSeekStepMs: Int64 = 10_000
var autoPlay = false
var continuousPlayback = true
var minPlaybackSpeed: Float = 0.5
var maxPlaybackSpeed: Float = 2.0
}
enum LoopMode {
case off
case one
case all
}
enum SwipeAction {
case none
case rewind
case forward
case previousSentence
case nextSentence
case previousSentenceOrRewind
case nextSentenceOrForward
}
enum GestureKind {
case singleTap
case swipeLeft
case swipeRight
case longPressSpeed
}
enum BoundaryState: Equatable {
case idle
case loading(isLocal: Bool)
case loaded(count: Int)
case failed(message: String)
}