Skip to content

Commit

Permalink
Bump minimal support version to tvOS 16
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Ye authored and yichengchen committed Nov 10, 2023
1 parent da743ca commit 3fb9e58
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 19 deletions.
8 changes: 4 additions & 4 deletions BilibiliLive.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@
SDKROOT = appletvos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TVOS_DEPLOYMENT_TARGET = 14.3;
TVOS_DEPLOYMENT_TARGET = 16.0;
};
name = Debug;
};
Expand Down Expand Up @@ -762,7 +762,7 @@
SDKROOT = appletvos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
TVOS_DEPLOYMENT_TARGET = 14.3;
TVOS_DEPLOYMENT_TARGET = 16.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand Down Expand Up @@ -795,7 +795,7 @@
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 15.0;
TVOS_DEPLOYMENT_TARGET = 16.0;
};
name = Debug;
};
Expand Down Expand Up @@ -826,7 +826,7 @@
SWIFT_OBJC_BRIDGING_HEADER = "BilibiliLive/Supporting Files/BilibiliLive-Bridging-Header.h";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 15.0;
TVOS_DEPLOYMENT_TARGET = 16.0;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,7 @@ class FeedCollectionViewController: UIViewController {
}

private var selfSizeingEnable: Bool {
if #available(tvOS 16.0, *) {
return true
}
return false
true
}

private func makeGridLayoutSection() -> NSCollectionLayoutSection {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,7 @@ class CommonPlayerViewController: AVPlayerViewController {
let speedActions = PlaySpeed.blDefaults.map { playSpeed in
UIAction(title: playSpeed.name, state: player?.rate ?? 1 == playSpeed.value ? .on : .off) { [weak self] _ in
self?.player?.currentItem?.audioTimePitchAlgorithm = .timeDomain
if #available(tvOS 16.0, *) {
self?.selectSpeed(AVPlaybackSpeed(rate: playSpeed.value, localizedName: playSpeed.name))
} else {
self?.player?.rate = playSpeed.value
}
self?.selectSpeed(AVPlaybackSpeed(rate: playSpeed.value, localizedName: playSpeed.name))
self?.danMuView.playingSpeed = playSpeed.value
}
}
Expand Down
8 changes: 2 additions & 6 deletions BilibiliLive/Component/Video/VideoPlayerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -421,14 +421,10 @@ extension VideoPlayerViewController {
}
}
}
if #available(tvOS 16.0, *),
let defaultRate = self.player?.defaultRate,
let speed = PlaySpeed.blDefaults.first(where: { $0.value == defaultRate })
{
if let defaultRate = self.player?.defaultRate,
let speed = PlaySpeed.blDefaults.first(where: { $0.value == defaultRate }) {
self.player = player
selectSpeed(AVPlaybackSpeed(rate: speed.value, localizedName: speed.name))
} else {
self.player = player
}
}
}

0 comments on commit 3fb9e58

Please sign in to comment.