2022-06-18 18:09:49 +05:30
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct NetworkState: View {
|
2022-09-02 04:49:15 +05:30
|
|
|
@ObservedObject private var model = NetworkStateModel.shared
|
2022-06-18 18:09:49 +05:30
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
Buffering(state: model.fullStateText)
|
2022-09-02 04:35:31 +05:30
|
|
|
.opacity(model.osdVisible ? 1 : 0)
|
2022-06-18 18:09:49 +05:30
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct NetworkState_Previews: PreviewProvider {
|
|
|
|
static var previews: some View {
|
|
|
|
let networkState = NetworkStateModel()
|
|
|
|
networkState.bufferingState = 30
|
|
|
|
|
|
|
|
return NetworkState()
|
|
|
|
.environmentObject(networkState)
|
|
|
|
.environmentObject(PlayerModel())
|
|
|
|
}
|
|
|
|
}
|