Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AudioPlayer/AudioPlayer/player/AudioPlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ public class AudioPlayer: NSObject {

/// Updates the MPNowPlayingInfoCenter with current item's info.
func updateNowPlayingInfoCenter() {
#if os(iOS) || os(tvOS)
#if !os(macOS)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no way to s.osx.exclude_files = 'AudioPlayer/AudioPlayer/utils/MPNowPlayingInfoCenter+AudioItem.swift' on SPM.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@delannoyk Bump :)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for the delay! If you don't mind, I'd appreciate this change 😄

@ppamorim ppamorim Apr 24, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@delannoyk ? Is there any concise reason for that?

@delannoyk delannoyk Apr 24, 2025

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels more correct to me to include the platform we know are supported, rather than exclude the ones we know aren't. I.E: what about watchOS, visionOS? I actually haven't tested those platforms but I would want to before saying they're supported for that code path. Does that make sense?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems right. Thank you for the response. I will update it when I have time.

if let item = currentItem {
MPNowPlayingInfoCenter.default().ap_update(
with: item,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Kevin DELANNOY on 27/03/16.
// Copyright © 2016 Kevin Delannoy. All rights reserved.
//

#if !os(macOS)
import MediaPlayer

extension MPNowPlayingInfoCenter {
Expand Down Expand Up @@ -47,3 +47,4 @@ extension MPNowPlayingInfoCenter {
nowPlayingInfo = info
}
}
#endif
37 changes: 37 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// swift-tools-version:5.3
import PackageDescription

let package = Package(
name: "KDEAudioPlayer",
platforms: [
.iOS(.v8),
.tvOS(.v9),
.macOS(.v10_10)
],
products: [
.library(
name: "KDEAudioPlayer",
targets: ["KDEAudioPlayer"]
),
],
dependencies: [],
targets: [
.target(
name: "KDEAudioPlayer",
dependencies: [],
path: "AudioPlayer/AudioPlayer",
// exclude: [
// "utils/MPNowPlayingInfoCenter+AudioItem.swift"
// ],
sources: ["."],
publicHeadersPath: "",
linkerSettings: [
.linkedFramework("AVFoundation"),
.linkedFramework("MediaPlayer"),
.linkedFramework("SystemConfiguration"),
.linkedFramework("UIKit", .when(platforms: [.iOS, .tvOS])),
.linkedFramework("Foundation", .when(platforms: [.macOS]))
]
)
]
)