|
@@ -7,7 +7,9 @@ open class AudioPlayerView: UIView {
|
|
|
lazy var playButton: UIButton = {
|
|
|
let playButton = UIButton(type: .custom)
|
|
|
let playImage = UIImage(named: "play")
|
|
|
+ playImage?.isAccessibilityElement = false
|
|
|
let pauseImage = UIImage(named: "pause")
|
|
|
+ pauseImage?.isAccessibilityElement = false
|
|
|
playButton.setImage(playImage?.withRenderingMode(.alwaysTemplate), for: .normal)
|
|
|
playButton.setImage(pauseImage?.withRenderingMode(.alwaysTemplate), for: .selected)
|
|
|
playButton.imageView?.contentMode = .scaleAspectFit
|
|
@@ -15,6 +17,7 @@ open class AudioPlayerView: UIView {
|
|
|
playButton.contentHorizontalAlignment = .fill
|
|
|
playButton.translatesAutoresizingMaskIntoConstraints = false
|
|
|
playButton.isUserInteractionEnabled = true
|
|
|
+ playButton.accessibilityLabel = String.localized("menu_play")
|
|
|
return playButton
|
|
|
}()
|
|
|
|
|
@@ -80,6 +83,7 @@ open class AudioPlayerView: UIView {
|
|
|
progressView.progress = 0
|
|
|
playButton.isSelected = false
|
|
|
durationLabel.text = "0:00"
|
|
|
+ playButton.accessibilityLabel = String.localized("menu_play")
|
|
|
}
|
|
|
|
|
|
open func setProgress(_ progress: Float) {
|
|
@@ -106,5 +110,6 @@ open class AudioPlayerView: UIView {
|
|
|
|
|
|
open func showPlayLayout(_ play: Bool) {
|
|
|
playButton.isSelected = play
|
|
|
+ playButton.accessibilityLabel = play ? String.localized("menu_pause") : String.localized("menu_play")
|
|
|
}
|
|
|
}
|