diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift index e12ba8b07..103c18056 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift @@ -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: { diff --git a/apple/OmnivoreKit/Sources/Utils/FeatureFlags.swift b/apple/OmnivoreKit/Sources/Utils/FeatureFlags.swift index 5c0aab9af..5ace227a6 100644 --- a/apple/OmnivoreKit/Sources/Utils/FeatureFlags.swift +++ b/apple/OmnivoreKit/Sources/Utils/FeatureFlags.swift @@ -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 }