Skip to content

Commit

Permalink
Make the player custom slider accessible via VoiceOver (#995)
Browse files Browse the repository at this point in the history
  • Loading branch information
defagos authored Aug 30, 2024
1 parent 02125e7 commit 2190f45
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Demo/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@
},
"Presenter mode" : {

},
"Progress" : {

},
"Project" : {

Expand Down
11 changes: 11 additions & 0 deletions Demo/Sources/Views/PlaybackSlider~ios.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ struct PlaybackSlider<ValueLabel>: View where ValueLabel: View {
}
)
.frame(maxWidth: .infinity)
.accessibilityRepresentation {
Slider(
progressTracker: progressTracker,
label: {
Text("Progress")
},
minimumValueLabel: minimumValueLabel,
maximumValueLabel: maximumValueLabel
)
}
.accessibilityAddTraits(.updatesFrequently)
.onReceive(player: progressTracker.player, assign: \.buffer, to: $buffer)
}

Expand Down

0 comments on commit 2190f45

Please sign in to comment.