mirror of
https://gitlab.com/futo-org/fcast.git
synced 2025-09-01 03:53:07 +00:00
Sender SDK
This commit is contained in:
parent
fdbefc63e0
commit
afc46f3022
147 changed files with 17638 additions and 114 deletions
42
sdk/sender/examples/ios/FCast Sender/FCast_SenderApp.swift
Normal file
42
sdk/sender/examples/ios/FCast Sender/FCast_SenderApp.swift
Normal file
|
@ -0,0 +1,42 @@
|
|||
import SwiftUI
|
||||
import Synchronization
|
||||
import Combine
|
||||
import Network
|
||||
|
||||
struct FoundDevice {
|
||||
var name: String
|
||||
var endpoint: NWEndpoint
|
||||
var proto: ProtocolType
|
||||
}
|
||||
|
||||
enum SheetState {
|
||||
case deviceList
|
||||
case connecting(deviceName: String)
|
||||
case failedToConnect(deviceName: String, reason: String)
|
||||
case connected
|
||||
}
|
||||
|
||||
@MainActor
|
||||
class DataModel: ObservableObject {
|
||||
@Published var playbackState = PlaybackState.idle
|
||||
@Published var volume = 1.0
|
||||
@Published var time = 0.0
|
||||
@Published var duration = 0.0
|
||||
@Published var speed = 1.0
|
||||
@Published var devices: Array<FoundDevice> = Array()
|
||||
@Published var showingDeviceList = false
|
||||
@Published var showingConnectingToDevice = false
|
||||
@Published var showingFailedToConnect = false
|
||||
@Published var isShowingSheet = false
|
||||
@Published var sheetState = SheetState.deviceList
|
||||
@Published var usedLocalAddress: IpAddr? = nil
|
||||
}
|
||||
|
||||
@main
|
||||
struct FCast_SenderApp: App {
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
try! ContentView(data: DataModel())
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue