Playhead is a modern, highly professional C# library that serves as a wrapper around the Windows NowPlayingSessionManager (NPSM) and System Media Transport Controls (SMTC) private APIs.
Designed for 2026 and beyond, Playhead allows developers to seamlessly interact with media sessions across the system. It enables reading "Now Playing" data (metadata, timeline, playback status) and controlling media playback remotely for supported applications such as Spotify, Chrome, Edge, VLC, and Windows Media Player.
- Features
- Compatibility
- Supported Applications
- Installation
- Quick Start
- Documentation
- Contributing
- Security
- License
- Full Media Metadata Access: Retrieve title, artist, album, genres, and even high-quality thumbnail streams.
- Playback Control: Programmatically Play, Pause, Next, Previous, Stop, and seek timeline positions.
- Session Tracking: Monitor the lifecycle of all media sessions active on the Windows machine.
- Modern & Legacy .NET Support: Targets everything from
.NET Framework 4.5and.NET Standard 1.1through.NET 11.0, coveringnetstandard1.1–2.1,netcoreapp3.0/3.1,net5.0–net11.0, andnet45–net481. - Nullable Reference Types: Built with modern C# standards including null-safety and
LangVersion=preview. - Debugger-Friendly: Ships with SourceLink and symbol packages (
.snupkg) for step-through debugging straight from NuGet.
Playhead requires Windows 10 Version 1511 (Build 10586) or newer.
Note on UWP/WinUI: If you are building a modern Windows App (UWP/WinUI 3), you must ensure your app manifest includes the globalMediaControl capability to avoid access denied exceptions.
<uap7:Capability Name="globalMediaControl" />Note on threading: SessionListChanged and MediaPlaybackDataChanged are delivered through COM callbacks from an out-of-process Windows service. If you create NowPlayingSessionManager on a Single-Threaded Apartment (STA) thread (e.g. a WinForms/WPF UI thread), that thread must keep pumping its message loop (Application.Run, etc.) for events to arrive. Plain console apps/background threads that don't opt into [STAThread] run as a Multi-Threaded Apartment (MTA) by default and don't need a message loop.
Playhead can interact with any application that integrates with the Windows SMTC APIs. For a comprehensive list of supported apps and browsers, check our Supported Apps Documentation.
You can install Playhead via the NuGet Package Manager:
dotnet add package Playheadusing Playhead.Data;
using Playhead.Enums;
using Playhead.Models;
using Playhead.Managers;
using Playhead.Sessions;
// Initialize the Session Manager
var manager = new NowPlayingSessionManager();
// Get the current active session
NowPlayingSession session = manager.CurrentSession;
if (session != null)
{
// Activate the playback data source to read metadata / control playback
MediaPlaybackDataSource src = session.ActivateMediaPlaybackDataSource();
MediaObjectInfo mediaInfo = src.GetMediaObjectInfo();
Console.WriteLine($"Currently Playing: {mediaInfo.Title} by {mediaInfo.Artist}");
// Pause the playback
src.SendMediaPlaybackCommand(MediaPlaybackCommands.Pause);
}Playhead raises events both when the active session changes and when the current session's playback data changes, so you don't have to poll:
manager.SessionListChanged += (sender, args) =>
{
NowPlayingSession session = manager.CurrentSession;
if (session != null)
{
MediaPlaybackDataSource src = session.ActivateMediaPlaybackDataSource();
src.MediaPlaybackDataChanged += (s, e) =>
{
MediaTimelineProperties timeline = src.GetMediaTimelineProperties();
Console.WriteLine($"Position: {timeline.Position} / {timeline.EndTime}");
};
}
};NowPlayingSessionManager, NowPlayingSession, NowPlayingSessionInfo, and MediaPlaybackDataSource wrap native COM resources and implement IDisposable. Dispose of them once you're done so the underlying COM references and event registrations are released deterministically instead of waiting for garbage collection:
using NowPlayingSessionManager manager = new();
NowPlayingSession session = manager.CurrentSession;
if (session != null)
{
using MediaPlaybackDataSource src = session.ActivateMediaPlaybackDataSource();
MediaObjectInfo mediaInfo = src.GetMediaObjectInfo();
Console.WriteLine($"Currently Playing: {mediaInfo.Title} by {mediaInfo.Artist}");
}If you're subscribing to SessionListChanged / MediaPlaybackDataChanged for the lifetime of your application, keep the manager (and any activated data sources) alive for as long as you need those events, and dispose of them during shutdown instead.
See the samples folder for complete, runnable console, .NET Framework, and UWP examples.
Playhead ships with full XML documentation comments, so IntelliSense will guide you through the entire public API directly in Visual Studio / VS Code / Rider. For deeper API exploration, browse the src/Playhead source directly.
Contributions are welcome! Please read CONTRIBUTING.md for details on our development setup, coding guidelines, and the process for submitting pull requests.
If you discover a security vulnerability, please follow the responsible disclosure process described in SECURITY.md rather than opening a public issue.
This project is licensed under the MIT License - see the LICENSE file for details. Copyright © 2026 Taiizor
