From ba00067692dd12e764c25189478e8f5684c128af Mon Sep 17 00:00:00 2001 From: "Mr.zhou" <1422157428@qq.com> Date: Tue, 11 Jun 2024 14:16:59 +0800 Subject: [PATCH] =?UTF-8?q?B=E9=9D=A21.0.6=EF=BC=8C=E8=93=9D=E7=89=99?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- relax.offline.mp3.music/AppDelegate.swift | 4 ++-- .../Base(公用基类)/Controllers/MP_LunchViewController.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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}