Created
April 25, 2025 05:57
-
-
Save kmansoft/e104c177fc9e2e4010c8f1d8301917e2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
@State private var currentCGImage: CGImage? | |
@State private var stateServerUrl: String = "" | |
@State private var stateAuthToken: String = "" | |
private let captureManager = CaptureManager() | |
var body: some View { | |
VStack { | |
CameraPreviewView(image: $currentCGImage) | |
.onAppear() { | |
captureManager.setCameraCallback { [self] (image: CGImage?) in | |
NSLog("Camera callback: \(image?.width ?? 0) x \(image?.height ?? 0)") | |
self.currentCGImage = image | |
} | |
} | |
Grid { | |
GridRow { | |
Text("Server URL") | |
TextField("https://example.com/whip", | |
text: $stateServerUrl) | |
} | |
GridRow { | |
Text("Auth token") | |
TextField("", | |
text: $stateAuthToken) | |
} | |
} | |
Button(action: { }) { | |
Text("Connect") | |
} | |
} | |
.padding() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment