diff --git a/Package@swift-5.9.swift b/Package@swift-5.9.swift new file mode 100644 index 000000000..e41ee56c3 --- /dev/null +++ b/Package@swift-5.9.swift @@ -0,0 +1,25 @@ +// swift-tools-version:5.9 +import PackageDescription + +let package = Package( + name: "Nuke", + platforms: [ + .iOS(.v13), + .tvOS(.v13), + .macOS(.v10_15), + .watchOS(.v6), + .visionOS(.v1), + ], + products: [ + .library(name: "Nuke", targets: ["Nuke"]), + .library(name: "NukeUI", targets: ["NukeUI"]), + .library(name: "NukeVideo", targets: ["NukeVideo"]), + .library(name: "NukeExtensions", targets: ["NukeExtensions"]) + ], + targets: [ + .target(name: "Nuke"), + .target(name: "NukeUI", dependencies: ["Nuke"]), + .target(name: "NukeVideo", dependencies: ["Nuke"]), + .target(name: "NukeExtensions", dependencies: ["Nuke"]) + ] +) diff --git a/Sources/NukeVideo/ImageDecoders+Video.swift b/Sources/NukeVideo/ImageDecoders+Video.swift index 94620314a..014989e37 100644 --- a/Sources/NukeVideo/ImageDecoders+Video.swift +++ b/Sources/NukeVideo/ImageDecoders+Video.swift @@ -2,7 +2,7 @@ // // Copyright (c) 2015-2023 Alexander Grebenyuk (github.com/kean). -#if !os(watchOS) +#if !os(watchOS) && !os(visionOS) import Foundation import AVKit diff --git a/Sources/NukeVideo/VideoPlayerView.swift b/Sources/NukeVideo/VideoPlayerView.swift index 2dc0ee1f6..343155196 100644 --- a/Sources/NukeVideo/VideoPlayerView.swift +++ b/Sources/NukeVideo/VideoPlayerView.swift @@ -137,7 +137,11 @@ public final class VideoPlayerView: _PlatformBaseView { let playerItem = AVPlayerItem(asset: asset) let player = AVQueuePlayer(playerItem: playerItem) player.isMuted = true - player.preventsDisplaySleepDuringVideoPlayback = false +#if os(visionOS) + player.preventsAutomaticBackgroundingDuringVideoPlayback = false +#else + player.preventsDisplaySleepDuringVideoPlayback = false +#endif player.actionAtItemEnd = isLooping ? .none : .pause self.player = player