mobileplayer-ios icon indicating copy to clipboard operation
mobileplayer-ios copied to clipboard

Volume is muted when device is on Silent mode ?

Open fadylateef opened this issue 7 years ago • 3 comments

Tested on all devices , videos mute volume when phone on silent mode and volume comes back when change device ringing mode to general mode.

fadylateef avatar May 26 '17 20:05 fadylateef

I have the same issue...

DevWiy avatar Jun 05 '17 09:06 DevWiy

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 avatar Aug 18 '17 15:08 mouness2020

@mouness2020 @fadylateef @DevWiy put that code before present function help player work file. Thanks

thanhBkap avatar Nov 10 '17 08:11 thanhBkap