Skip to content

Commit 46f7e29

Browse files
committed
update
1 parent 849a782 commit 46f7e29

File tree

5 files changed

+17
-2
lines changed

5 files changed

+17
-2
lines changed

swiftui-loop-videoplayer-example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
WEBVTT
2+
3+
00:00:00.000 --> 00:00:03.000
4+
This is Elephants Dream.
5+
6+
00:00:03.000 --> 00:00:06.000
7+
The first open-source 3D animated movie.
8+
9+
00:00:06.000 --> 00:00:09.000
10+
Enjoy watching!

swiftui-loop-videoplayer-example/views/controls/TimeSlider.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ struct TimeSlider: View {
2626
private var sliderTpl: some View{
2727
HStack {
2828
Text(formatTime(currentTime))
29+
.padding(.leading, 15)
2930
Slider(value: $currentTime, in: 0...duration, onEditingChanged: onEditingChanged)
3031
.disabled(duration == 0 || isSeeking == true)
3132
Text(formatTime(duration))
32-
}.padding()
33+
.padding(.trailing, 15)
34+
}.padding(5)
3335
.background(RoundedRectangle(cornerRadius: 50).fill(.gray.opacity(0.75)))
3436
.padding(.horizontal)
3537
}

swiftui-loop-videoplayer-example/views/controls/VideoURLPicker.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,7 @@ fileprivate let videoOptions = [
3636

3737
extension VideoURLPicker{
3838

39+
static let subtitledVideo = "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4"
40+
3941
static let initVideo = "https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/master.m3u8"
4042
}

swiftui-loop-videoplayer-example/views/video/Video8.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ struct Video8: VideoTpl {
9595

9696
fileprivate func getSettings(for name: String) -> VideoSettings{
9797
VideoSettings {
98+
Subtitles(name == VideoURLPicker.subtitledVideo ? "subtitles_eng" : "")
9899
SourceName(name)
99100
Gravity(.resizeAspectFill)
100101
TimePublishing()

0 commit comments

Comments
 (0)