diff --git a/relax.offline.mp3.music/AppDelegate.swift b/relax.offline.mp3.music/AppDelegate.swift index 9cdfbd4..b20476f 100644 --- a/relax.offline.mp3.music/AppDelegate.swift +++ b/relax.offline.mp3.music/AppDelegate.swift @@ -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)") } diff --git a/relax.offline.mp3.music/MP/Common/Base(公用基类)/Controllers/MP_LunchViewController.swift b/relax.offline.mp3.music/MP/Common/Base(公用基类)/Controllers/MP_LunchViewController.swift index 6ff7b64..053f745 100644 --- a/relax.offline.mp3.music/MP/Common/Base(公用基类)/Controllers/MP_LunchViewController.swift +++ b/relax.offline.mp3.music/MP/Common/Base(公用基类)/Controllers/MP_LunchViewController.swift @@ -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}