Skip to content

Commit eee0ec2

Browse files
committed
temp
1 parent 9cef7b8 commit eee0ec2

File tree

9 files changed

+828
-143
lines changed

9 files changed

+828
-143
lines changed

Examples/CLIExample/index.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,15 @@ enum CLIExample {
124124
width: 1080,
125125
height: 1920,
126126
displayScale: 2.0,
127-
captureDuration: .seconds(10),
127+
captureDuration: .seconds(7),
128128
saveVideoFile: true
129129
) {
130130
// BasicCounterView(initialCounter: 0)
131131
// VideoTestView()
132-
// ImageTestView()
133-
SoundTestView()
132+
ImageTestView()
133+
// SoundTestView()
134+
// SpriteKitTestView()
135+
// SceneKitTestView()
134136
}
135137

136138
let controlledClock = recorder.controlledClock

Examples/VideoViews/ImageTestView.swift

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,32 @@ import SwiftUI
1111
public struct ImageTestView: View {
1212
@Environment(\.recorder) private var recorder
1313

14-
let url = "https://sample-videos.com/img/Sample-jpg-image-5mb.jpg"
14+
@State private var currentImageIndex = 0
15+
16+
let imageUrls = [
17+
"https://sample-videos.com/img/Sample-jpg-image-5mb.jpg",
18+
"https://mogged-pullzone.b-cdn.net/people/8336bde2-3d36-41c3-a8ad-9c9d5413eff6.jpg?class=mobile",
19+
"https://mogged-pullzone.b-cdn.net/people/0880cf5d-10d1-49b2-b468-e84d19f5bdca.jpg",
20+
"https://mogged-pullzone.b-cdn.net/people/08c08ae7-732e-4966-917f-f94174daa024.jpg",
21+
"https://mogged-pullzone.b-cdn.net/people/0a4f6fc6-bc77-4b4a-9dfb-c690b5931625.jpg"
22+
]
1523

1624
public init() {}
1725
public var body: some View {
18-
StreamingImage(url: URL(string: url)!)
19-
.frame(width: 500, height: 900)
26+
VStack {
27+
StreamingImage(url: URL(string: imageUrls[currentImageIndex])!, scaleType: .fill)
28+
.frame(width: 1080, height: 1920)
29+
.id(currentImageIndex)
30+
}
31+
.onAppear(perform: startTimer)
32+
}
2033

21-
// VideoPlayer(player: AVPlayer(url: URL(string: "https://file-examples.com/storage/fed5266c9966708dcaeaea6/2017/04/file_example_MP4_480_1_5MG.mp4")!))
22-
// .frame(height: 400)
34+
private func startTimer() {
35+
Task {
36+
while true {
37+
try await recorder?.controlledClock.clock.sleep(for: .milliseconds(1000))
38+
currentImageIndex = (currentImageIndex + 1) % imageUrls.count
39+
}
40+
}
2341
}
2442
}

0 commit comments

Comments
 (0)