From 0407d533fd2c00d3d03233f566a46622326140ef Mon Sep 17 00:00:00 2001 From: yicheng <11733500+yichengchen@users.noreply.github.com> Date: Sat, 8 Jul 2023 10:38:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0preferavc=E5=BC=80?= =?UTF-8?q?=E5=85=B3=EF=BC=8C=E4=BD=8E=E6=80=A7=E8=83=BD=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E5=90=AF=E7=94=A8=E5=90=8E=E5=87=8F=E5=B0=91=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E5=8D=A1=E9=A1=BF=E6=8E=89=E5=B8=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Player/BilibiliVideoResourceLoaderDelegate.swift | 6 +++--- BilibiliLive/Component/Settings.swift | 4 ++-- BilibiliLive/Module/Personal/SettingsViewController.swift | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/BilibiliLive/Component/Player/BilibiliVideoResourceLoaderDelegate.swift b/BilibiliLive/Component/Player/BilibiliVideoResourceLoaderDelegate.swift index 59476a36..7ccbc907 100644 --- a/BilibiliLive/Component/Player/BilibiliVideoResourceLoaderDelegate.swift +++ b/BilibiliLive/Component/Player/BilibiliVideoResourceLoaderDelegate.swift @@ -238,9 +238,9 @@ class BilibiliVideoResourceLoaderDelegate: NSObject, AVAssetResourceLoaderDelega reset() hasSubtitle = subtitles.count > 0 var videos = info.dash.video - if Settings.preferHevc { - if videos.contains(where: { $0.isHevc }) { - videos.removeAll(where: { !$0.isHevc }) + if Settings.preferAvc { + if videos.contains(where: { !$0.isHevc }) { + videos.removeAll(where: { $0.isHevc }) } } diff --git a/BilibiliLive/Component/Settings.swift b/BilibiliLive/Component/Settings.swift index 75c3534b..edc3c92f 100644 --- a/BilibiliLive/Component/Settings.swift +++ b/BilibiliLive/Component/Settings.swift @@ -36,8 +36,8 @@ enum Settings { @UserDefault("Settings.losslessAudio", defaultValue: false) static var losslessAudio: Bool - @UserDefault("Settings.preferHevc", defaultValue: false) - static var preferHevc: Bool + @UserDefault("Settings.preferAvc", defaultValue: false) + static var preferAvc: Bool @UserDefault("Settings.defaultDanmuStatus", defaultValue: true) static var defaultDanmuStatus: Bool diff --git a/BilibiliLive/Module/Personal/SettingsViewController.swift b/BilibiliLive/Module/Personal/SettingsViewController.swift index dbe154ee..5688a7c4 100644 --- a/BilibiliLive/Module/Personal/SettingsViewController.swift +++ b/BilibiliLive/Module/Personal/SettingsViewController.swift @@ -135,9 +135,9 @@ class SettingsViewController: UIViewController { } cellModels.append(losslessAudio) - let hevc = CellModel(title: "Hevc优先", desp: Settings.preferHevc ? "开" : "关") { + let hevc = CellModel(title: "Avc优先(卡顿尝试开启)", desp: Settings.preferAvc ? "开" : "关") { [weak self] in - Settings.preferHevc.toggle() + Settings.preferAvc.toggle() self?.setupData() } cellModels.append(hevc)