mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
Code style change
This commit is contained in:
parent
661de78ab3
commit
c51b9dd8e8
@ -455,7 +455,8 @@ final class AVPlayerBackend: PlayerBackend {
|
|||||||
switch playerItem.status {
|
switch playerItem.status {
|
||||||
case .readyToPlay:
|
case .readyToPlay:
|
||||||
if self.model.activeBackend == .appleAVPlayer,
|
if self.model.activeBackend == .appleAVPlayer,
|
||||||
self.isAutoplaying(playerItem) {
|
self.isAutoplaying(playerItem)
|
||||||
|
{
|
||||||
self.model.updateAspectRatio()
|
self.model.updateAspectRatio()
|
||||||
self.model.play()
|
self.model.play()
|
||||||
}
|
}
|
||||||
|
@ -9,9 +9,7 @@ extension PlayerModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func play(_ videos: [Video]) {
|
func play(_ videos: [Video]) {
|
||||||
videos.forEach { video in
|
videos.forEach { enqueueVideo($0, loadDetails: false) }
|
||||||
enqueueVideo(video, loadDetails: false)
|
|
||||||
}
|
|
||||||
|
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
onPresentPlayer = { [weak self] in self?.advanceToNextItem() }
|
onPresentPlayer = { [weak self] in self?.advanceToNextItem() }
|
||||||
|
@ -30,9 +30,7 @@ struct PlayerBackendView: View {
|
|||||||
}
|
}
|
||||||
.overlay(GeometryReader { proxy in
|
.overlay(GeometryReader { proxy in
|
||||||
Color.clear
|
Color.clear
|
||||||
.onAppear {
|
.onAppear { player.playerSize = proxy.size }
|
||||||
player.playerSize = proxy.size
|
|
||||||
}
|
|
||||||
.onChange(of: proxy.size) { _ in player.playerSize = proxy.size }
|
.onChange(of: proxy.size) { _ in player.playerSize = proxy.size }
|
||||||
.onChange(of: player.controls.presentingOverlays) { _ in player.playerSize = proxy.size }
|
.onChange(of: player.controls.presentingOverlays) { _ in player.playerSize = proxy.size }
|
||||||
.onChange(of: player.aspectRatio) { _ in player.playerSize = proxy.size }
|
.onChange(of: player.aspectRatio) { _ in player.playerSize = proxy.size }
|
||||||
|
@ -37,11 +37,9 @@ struct VideoCell: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
Group {
|
|
||||||
Button(action: playAction) {
|
Button(action: playAction) {
|
||||||
content
|
content
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.opacity(contentOpacity)
|
.opacity(contentOpacity)
|
||||||
.buttonStyle(.plain)
|
.buttonStyle(.plain)
|
||||||
.contentShape(RoundedRectangle(cornerRadius: thumbnailRoundingCornerRadius))
|
.contentShape(RoundedRectangle(cornerRadius: thumbnailRoundingCornerRadius))
|
||||||
|
@ -7,12 +7,12 @@ struct ContentItemView: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
Group {
|
Group {
|
||||||
switch item.contentType {
|
switch item.contentType {
|
||||||
|
case .video:
|
||||||
|
VideoCell(video: item.video)
|
||||||
case .playlist:
|
case .playlist:
|
||||||
ChannelPlaylistCell(playlist: item.playlist)
|
ChannelPlaylistCell(playlist: item.playlist)
|
||||||
case .channel:
|
case .channel:
|
||||||
ChannelCell(channel: item.channel)
|
ChannelCell(channel: item.channel)
|
||||||
case .video:
|
|
||||||
VideoCell(video: item.video)
|
|
||||||
default:
|
default:
|
||||||
PlaceholderCell()
|
PlaceholderCell()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user