mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
Minor fixes
This commit is contained in:
parent
ea2b6f9932
commit
4f1520a6ce
@ -24,7 +24,8 @@ final class PiPDelegate: NSObject, AVPictureInPictureControllerDelegate {
|
||||
}
|
||||
|
||||
if player.avPlayerBackend.switchToMPVOnPipClose,
|
||||
!player.currentItem.isNil {
|
||||
!player.currentItem.isNil
|
||||
{
|
||||
DispatchQueue.main.async {
|
||||
player.avPlayerBackend.switchToMPVOnPipClose = false
|
||||
player.saveTime {
|
||||
|
@ -41,7 +41,7 @@ struct VideoPlayerView: View {
|
||||
var mouseLocation: CGPoint { NSEvent.mouseLocation }
|
||||
#endif
|
||||
|
||||
#if !os(macOS)
|
||||
#if os(iOS)
|
||||
@State private var viewVerticalOffset = Self.hiddenOffset
|
||||
#endif
|
||||
|
||||
@ -74,15 +74,11 @@ struct VideoPlayerView: View {
|
||||
.onReceive(NotificationCenter.default.publisher(for: UIDevice.orientationDidChangeNotification)) { _ in
|
||||
handleOrientationDidChangeNotification()
|
||||
}
|
||||
#endif
|
||||
.onChange(of: player.presentingPlayer) { newValue in
|
||||
if newValue {
|
||||
viewVerticalOffset = 0
|
||||
#if os(iOS)
|
||||
configureOrientationUpdatesBasedOnAccelerometer()
|
||||
#endif
|
||||
} else {
|
||||
#if os(iOS)
|
||||
if Defaults[.lockPortraitWhenBrowsing] {
|
||||
Orientation.lockOrientation(.portrait, andRotateTo: .portrait)
|
||||
} else {
|
||||
@ -92,14 +88,15 @@ struct VideoPlayerView: View {
|
||||
motionManager?.stopAccelerometerUpdates()
|
||||
motionManager = nil
|
||||
viewVerticalOffset = Self.hiddenOffset
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#if os(iOS)
|
||||
.offset(y: viewVerticalOffset)
|
||||
.opacity(viewVerticalOffset == Self.hiddenOffset ? 0 : 1)
|
||||
.animation(.easeIn(duration: 0.2), value: viewVerticalOffset)
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
var content: some View {
|
||||
|
@ -62,7 +62,6 @@ struct ChannelPlaylistView: View {
|
||||
}
|
||||
}
|
||||
.offset(y: viewVerticalOffset)
|
||||
.opacity(viewVerticalOffset == Self.hiddenOffset ? 0 : 1)
|
||||
.animation(.easeIn(duration: 0.2), value: viewVerticalOffset)
|
||||
#endif
|
||||
} else {
|
||||
@ -76,6 +75,7 @@ struct ChannelPlaylistView: View {
|
||||
VStack(alignment: .leading) {
|
||||
#if os(tvOS)
|
||||
HStack {
|
||||
if let playlist = presentedPlaylist {
|
||||
Text(playlist.title)
|
||||
.font(.title2)
|
||||
.frame(alignment: .leading)
|
||||
@ -84,6 +84,7 @@ struct ChannelPlaylistView: View {
|
||||
|
||||
FavoriteButton(item: FavoriteItem(section: .channelPlaylist(playlist.id, playlist.title)))
|
||||
.labelStyle(.iconOnly)
|
||||
}
|
||||
|
||||
playButton
|
||||
.labelStyle(.iconOnly)
|
||||
|
@ -58,7 +58,6 @@ struct ChannelVideosView: View {
|
||||
}
|
||||
}
|
||||
.offset(y: viewVerticalOffset)
|
||||
.opacity(viewVerticalOffset == Self.hiddenOffset ? 0 : 1)
|
||||
.animation(.easeIn(duration: 0.2), value: viewVerticalOffset)
|
||||
#endif
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user