B面1.0.6,蓝牙链接优化
This commit is contained in:
parent
866318c73f
commit
ba00067692
@ -47,10 +47,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
let session = AVAudioSession.sharedInstance()
|
||||
do {
|
||||
//允许后台活跃,播放以及记录
|
||||
try session.setCategory(.playAndRecord, mode: .default, options: [.allowAirPlay, .defaultToSpeaker, .allowBluetooth])
|
||||
try session.setCategory(.playAndRecord, mode: .default, options: [.allowBluetooth, .defaultToSpeaker])
|
||||
//激活会话
|
||||
try session.setActive(true)
|
||||
try session.overrideOutputAudioPort(.speaker)
|
||||
// try session.overrideOutputAudioPort(.speaker)
|
||||
} catch {
|
||||
print("Failed to set type:\(error.localizedDescription)")
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@ class MP_LunchViewController: UIViewController {
|
||||
if maxTimes > currentTimes {
|
||||
//未加载完
|
||||
currentTimes += 0.025
|
||||
let value = currentTimes/maxTimes
|
||||
let value = (currentTimes/maxTimes).isNaN ? 0:(currentTimes/maxTimes)
|
||||
DispatchQueue.main.async {
|
||||
[weak self] in
|
||||
guard let self = self else {return}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user