mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
add text to speech play button on web links
This commit is contained in:
parent
28c7d7be90
commit
f8f94e2e70
2 changed files with 19 additions and 0 deletions
|
|
@ -1,6 +1,8 @@
|
|||
import AVFoundation
|
||||
import Models
|
||||
import Services
|
||||
import SwiftUI
|
||||
import Utils
|
||||
import Views
|
||||
import WebKit
|
||||
|
||||
|
|
@ -68,6 +70,22 @@ struct WebReaderContainerView: View {
|
|||
.scaleEffect(navBarVisibilityRatio)
|
||||
Spacer()
|
||||
#endif
|
||||
if FeatureFlag.enableTextToSpeechButton {
|
||||
Button(
|
||||
action: {
|
||||
guard let htmlContent = item.htmlContent else { return }
|
||||
let synthesizer = AVSpeechSynthesizer()
|
||||
synthesizer.speak(AVSpeechUtterance(string: htmlContent))
|
||||
AVSpeechUtterance(ss,)
|
||||
},
|
||||
label: {
|
||||
Image(systemName: "play")
|
||||
.font(.appTitleTwo)
|
||||
}
|
||||
)
|
||||
.padding(.horizontal)
|
||||
.scaleEffect(navBarVisibilityRatio)
|
||||
}
|
||||
Button(
|
||||
action: { showPreferencesPopover.toggle() },
|
||||
label: {
|
||||
|
|
|
|||
|
|
@ -14,4 +14,5 @@ public enum FeatureFlag {
|
|||
public static let enableShareButton = false
|
||||
public static let enableSnooze = false
|
||||
public static let enableGridCardsOnPhone = false
|
||||
public static let enableTextToSpeechButton = true
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue