From: liangzhenying <867174124@qq.com> Date: Wed, 1 Apr 2026 08:09:49 +0000 (+0800) Subject: 字幕加了防崩溃处理 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=6d9bfadfd08f7edfc1b9213300fdc4483aa910c4;p=mirrors%2FShenYin.git 字幕加了防崩溃处理 --- diff --git a/ShenYin/ShenYin/Channel/PLAYBOY/Channel/UI/PbSubTitleVC.swift b/ShenYin/ShenYin/Channel/PLAYBOY/Channel/UI/PbSubTitleVC.swift index f1e6b52..fd733bc 100644 --- a/ShenYin/ShenYin/Channel/PLAYBOY/Channel/UI/PbSubTitleVC.swift +++ b/ShenYin/ShenYin/Channel/PLAYBOY/Channel/UI/PbSubTitleVC.swift @@ -195,7 +195,9 @@ extension PbSubTitleVC:UITableViewDelegate,UITableViewDataSource { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = SubTitleCell.cell(withTableView: tableView, indexPath: indexPath) - cell.data = sdk.dataList[indexPath.row] + if indexPath.row < sdk.dataList.count { + cell.data = sdk.dataList[indexPath.row] + } return cell } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { diff --git a/ShenYin/ShenYin/UI/Home/SubTitle/PipContentVC.swift b/ShenYin/ShenYin/UI/Home/SubTitle/PipContentVC.swift index 038cb76..410fedc 100644 --- a/ShenYin/ShenYin/UI/Home/SubTitle/PipContentVC.swift +++ b/ShenYin/ShenYin/UI/Home/SubTitle/PipContentVC.swift @@ -40,51 +40,51 @@ class PipManager:NSObject,AVPictureInPictureControllerDelegate{ @objc func startPictureInPicture(){ guard let pipController = pipController else { - print("❌ pipController 未初始化,无法启动画中画") + Logger.debug("❌ pipController 未初始化,无法启动画中画") return } if pipController.isPictureInPicturePossible { - print("✅ 画中画可以启动,准备开始...") + Logger.debug("✅ 画中画可以启动,准备开始...") pipController.startPictureInPicture() contentVC?.reset() } else { - print("❌ 画中画当前无法启动") + Logger.debug("❌ 画中画当前无法启动") } } @objc func stopPictureInPicture() { guard let pipController = pipController else { - print("❌ pipController 未初始化,无法停止画中画") + Logger.debug("❌ pipController 未初始化,无法停止画中画") return } if pipController.isPictureInPictureActive { - print("✅ 画中画正在显示,准备停止...") + Logger.debug("✅ 画中画正在显示,准备停止...") pipController.stopPictureInPicture() - print("✅ 画中画已停止") + Logger.debug("✅ 画中画已停止") } else { - print("⚠️ 画中画当前未显示") + Logger.debug("⚠️ 画中画当前未显示") } } func pictureInPictureControllerWillStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) { - print("画中画即将开始") + Logger.debug("画中画即将开始") } func pictureInPictureControllerDidStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) { - print("✅ 画中画已开始") + Logger.debug("✅ 画中画已开始") } func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController, failedToStartPictureInPictureWithError error: Error) { - print("❌ 画中画启动失败: \(error)") + Logger.debug("❌ 画中画启动失败: \(error)") } func pictureInPictureControllerWillStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) { - print("⏹️ 画中画即将结束") + Logger.debug("⏹️ 画中画即将结束") } func pictureInPictureControllerDidStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) { - print("🛑 画中画已结束") + Logger.debug("🛑 画中画已结束") } }