YoutubePlayer-in-WKWebView icon indicating copy to clipboard operation
YoutubePlayer-in-WKWebView copied to clipboard

Change WKYTPlayerView output to speaker in Swift?

Open ArunVicky001 opened this issue 2 years ago • 0 comments

I am currently facing some issues with my application, I am trying to stream youtube videos in iOS 16.1 using WKYTPlayerView. here the player audio is not output to the speaker in Swift.

but previously it was working well.

I have tried the below code but it's not working

let audioSession = AVAudioSession.sharedInstance()

    do {
        try audioSession.setCategory(AVAudioSession.Category.playAndRecord, mode: AVAudioSession.Mode.voiceChat, options: AVAudioSession.CategoryOptions.mixWithOthers)
        try audioSession.overrideOutputAudioPort(.none)
        try audioSession.setActive(true)
    } catch {
        debugPrint(error.localizedDescription)
    }

can anyone please suggest something?

ArunVicky001 avatar Jan 18 '23 11:01 ArunVicky001