macos-media-info v0.1.3
Retrieve macOS Media Playback Metadata
Retrieves info of currently-playing media from various sources on macOS
This package provides methods to retrieve information of media playback via the following macOS APIs:
MediaRemote.framework
Retrieve metadata of the highest priority media session system-wide. This includes playback originating from any app which implements the macOS media session API.
Use this if you'd like to retrieve metadata of any media playback on the system, of which some examples include:
- Browsers
- Apple Music/TV
- Spotify
- etc.
Note that this method only returns metadata corresponding to the session with the highest priority, decided based on system heuristics. This means that the metadata need not necessarily always be that of a single application and may change based on the active media sessions at the moment.
ScriptingBridge
Retrieves metadata of media playback in Apple Music via its Scripting Bridge interface.
Note: Only supports Apple Music currently.
A native node plugin is used to interface with the aforementioned macOS APIs. This is the most efficient approach and does not involve invoking any additional binaries/shell commands.