mobileplayer-ios
mobileplayer-ios copied to clipboard
Volume is muted when device is on Silent mode ?
Tested on all devices , videos mute volume when phone on silent mode and volume comes back when change device ringing mode to general mode.
I have the same issue...
just add this code in your player Swift 3.0 and Xcode > 8
Play sound in Video when device is on RINGER mode and SLIENT mode
import AVFoundation
..........
do {
try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback)
//print("AVAudioSession Category Playback OK")
do {
try AVAudioSession.sharedInstance().setActive(true)
//print("AVAudioSession is Active")
} catch _ as NSError {
//print(error.localizedDescription)
}
} catch _ as NSError {
//print(error.localizedDescription)
}
@mouness2020 @fadylateef @DevWiy put that code before present function help player work file. Thanks