Posts

Post not yet marked as solved
6 Replies
7.2k Views
I tryed to play videos on WKWebView after the following codes.1. Set AVAudioSessionCategory to SoloAmbientdo { try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategorySoloAmbient) } catch let error as NSError { print(error) }Error was not print.2. Called setActive(true)do { try AVAudioSession.sharedInstance().setActive(true) } catch let error as NSError { print(error) }Error was not print.3. Checked current AVAudioSessionCategoryprint("audioSession.category = \(AVAudioSession.sharedInstance().category)")Output:audioSession.category = AVAudioSessionCategorySoloAmbientBut, WKWebView ignores status of Ring/Silent switch, outputs video sound even if state of the switch is Silent.I thought that this behavior is like AVAudioSessionCategoryPlayback.UIWebView does not ignore.Is there a solution?I use devices below.iPhone 5s : iOS 8.4.1iPhone 6 plus : iOS 9.
Posted
by 131e55.
Last updated
.