Playhead 1.0.4

dotnet add package Playhead --version 1.0.4
                    
NuGet\Install-Package Playhead -Version 1.0.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Playhead" Version="1.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Playhead" Version="1.0.4" />
                    
Directory.Packages.props
<PackageReference Include="Playhead" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Playhead --version 1.0.4
                    
#r "nuget: Playhead, 1.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Playhead@1.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Playhead&version=1.0.4
                    
Install as a Cake Addin
#tool nuget:?package=Playhead&version=1.0.4
                    
Install as a Cake Tool

Playhead

NuGet Version NuGet Downloads Build Status License .NET Standard 1.1 .NET Framework 4.5 .NET 8.0 .NET 11.0

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.

Table of Contents

Features

  • 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.5 and .NET Standard 1.1 through .NET 11.0, covering netstandard1.12.1, netcoreapp3.0/3.1, net5.0net11.0, and net45net481.
  • 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.

Compatibility

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.

Supported Applications

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.

Installation

You can install Playhead via the NuGet Package Manager:

dotnet add package Playhead

Quick Start

using 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);
}

Reacting to Changes

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}");
        };
    }
};

Disposal

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.

Documentation

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.

Contributing

Contributions are welcome! Please read CONTRIBUTING.md for details on our development setup, coding guidelines, and the process for submitting pull requests.

Security

If you discover a security vulnerability, please follow the responsible disclosure process described in SECURITY.md rather than opening a public issue.

License

This project is licensed under the MIT License - see the LICENSE file for details. Copyright © 2026 Taiizor

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed.  net11.0 is compatible. 
.NET Core netcoreapp1.0 was computed.  netcoreapp1.1 was computed.  netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 is compatible.  netcoreapp3.1 is compatible. 
.NET Standard netstandard1.1 is compatible.  netstandard1.2 is compatible.  netstandard1.3 is compatible.  netstandard1.4 is compatible.  netstandard1.5 is compatible.  netstandard1.6 is compatible.  netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 is compatible.  net461 is compatible.  net462 is compatible.  net463 was computed.  net47 is compatible.  net471 is compatible.  net472 is compatible.  net48 is compatible.  net481 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen30 was computed.  tizen40 was computed.  tizen60 was computed. 
Universal Windows Platform uap was computed.  uap10.0 was computed. 
Windows Phone wpa81 was computed. 
Windows Store netcore was computed.  netcore45 was computed.  netcore451 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.